@delmaredigital/payload-experiments 0.4.0-rc.1 → 0.4.0-rc.10
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 +284 -772
- package/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +2 -2
- package/dist/admin/PlacementStatus.js +1 -1
- package/dist/admin/TestsDashboardCards.d.ts +1 -0
- package/dist/admin/TestsDashboardCards.js +5 -9
- package/dist/admin/TestsNavLink.d.ts +1 -0
- package/dist/admin/TestsNavLink.js +5 -11
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +129 -37
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.d.ts +3 -0
- package/dist/admin/blocks/formApi.js +10 -4
- package/dist/admin/blocks/inject.js +1 -0
- package/dist/admin/blocks/model.d.ts +3 -2
- package/dist/admin/blocks/model.js +10 -6
- package/dist/admin/blocks/statusCache.d.ts +2 -0
- package/dist/admin/blocks/statusCache.js +12 -3
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +21 -1
- package/dist/admin/copy/blocks.js +40 -6
- package/dist/admin/copy/goals.d.ts +6 -1
- package/dist/admin/copy/goals.js +10 -3
- package/dist/admin/copy/newTest.d.ts +6 -7
- package/dist/admin/copy/newTest.js +9 -7
- package/dist/admin/goals/XpGoalField.d.ts +2 -0
- package/dist/admin/goals/XpGoalField.js +156 -114
- package/dist/admin/goals/xpGoalField.css +47 -0
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/paths.d.ts +3 -0
- package/dist/admin/paths.js +3 -0
- package/dist/admin/placementStatus.model.js +1 -1
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +20 -24
- package/dist/admin/surface/SurfaceShell.js +5 -2
- package/dist/admin/surface/TestRowMenu.d.ts +6 -0
- package/dist/admin/surface/TestRowMenu.js +156 -0
- package/dist/admin/surface/TestsHome.d.ts +5 -3
- package/dist/admin/surface/TestsHome.js +266 -58
- package/dist/admin/surface/TestsSurface.js +8 -7
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +95 -54
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +5 -4
- package/dist/admin/surface/goals/data.js +2 -2
- package/dist/admin/surface/goals/goals.css +7 -0
- package/dist/admin/surface/goals/goals.model.d.ts +11 -1
- package/dist/admin/surface/goals/goals.model.js +43 -0
- package/dist/admin/surface/home.model.d.ts +9 -8
- package/dist/admin/surface/home.model.js +22 -21
- package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
- package/dist/admin/surface/newTest/NewTest.js +98 -94
- package/dist/admin/surface/newTest/PageWizard.d.ts +2 -1
- package/dist/admin/surface/newTest/PageWizard.js +111 -76
- package/dist/admin/surface/newTest/newTest.css +28 -9
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +58 -54
- package/dist/admin/surface/surface.css +10 -0
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +42 -162
- package/dist/admin/theme.css +2 -0
- package/dist/admin/views/CollectionListRedirect.d.ts +1 -0
- package/dist/admin/views/CollectionListRedirect.js +1 -1
- package/dist/admin/views/ExperimentsRootView.js +18 -165
- package/dist/admin/views/GoalEditRedirect.d.ts +4 -0
- package/dist/admin/views/GoalEditRedirect.js +14 -0
- package/dist/admin/views/GoalsCollectionListView.d.ts +2 -0
- package/dist/admin/views/GoalsCollectionListView.js +4 -0
- package/dist/admin/views/TestsCollectionListView.d.ts +2 -0
- package/dist/admin/views/TestsCollectionListView.js +4 -0
- package/dist/admin/views/TestsNavLinkServer.d.ts +1 -0
- package/dist/admin/views/TestsNavLinkServer.js +2 -2
- package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
- package/dist/admin/views/TestsSurfaceClient.js +11 -0
- package/dist/admin/views/buildSurfaceProps.d.ts +8 -0
- package/dist/admin/views/buildSurfaceProps.js +102 -0
- package/dist/admin/views/renderCollectionList.d.ts +2 -0
- package/dist/admin/views/renderCollectionList.js +34 -0
- package/dist/admin/views/renderTestsSurface.d.ts +3 -0
- package/dist/admin/views/renderTestsSurface.js +34 -0
- package/dist/blocks/bindings.js +8 -14
- 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 +37 -0
- package/dist/blocks/placementLocale.js +270 -0
- package/dist/collections/experiments/config.js +17 -8
- 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/metrics.js +16 -4
- 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.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +111 -0
- 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/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- 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/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +407 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +57 -9
- package/dist/endpoints/pages.js +247 -64
- 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/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +41 -29
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +8 -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/adminRsc.d.ts +3 -0
- package/dist/exports/adminRsc.js +3 -0
- 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/fields/xpGoal.js +3 -15
- package/dist/goals/fairness.d.ts +1 -1
- package/dist/goals/fairness.js +44 -35
- package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
- package/dist/goals/picker/clickGoalPicker.model.js +20 -2
- package/dist/goals/picker/copy.d.ts +6 -2
- package/dist/goals/picker/copy.js +11 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/goals/validate.d.ts +3 -0
- package/dist/goals/validate.js +15 -0
- package/dist/hooks/blockRemovalRule.d.ts +30 -0
- package/dist/hooks/blockRemovalRule.js +165 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +27 -2
- package/dist/hooks/pageGuard.js +213 -45
- package/dist/hooks/puckGoals.d.ts +5 -0
- package/dist/hooks/puckGoals.js +62 -0
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/lib/placementPages.d.ts +10 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +10 -5
- package/dist/manifest/compile.d.ts +2 -1
- package/dist/manifest/compile.js +13 -6
- package/dist/onInit.js +36 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +19 -20
- 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.d.ts +2 -1
- package/dist/puck/ExperimentPicker.js +62 -40
- package/dist/puck/ExperimentSlot.js +3 -1
- package/dist/puck/copy.d.ts +5 -1
- package/dist/puck/copy.js +5 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +25 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +150 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +12 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +89 -21
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +951 -179
- package/dist/puck/editor/LeftoverVersions.d.ts +15 -0
- package/dist/puck/editor/LeftoverVersions.js +79 -0
- package/dist/puck/editor/PlacementNotice.d.ts +8 -0
- package/dist/puck/editor/PlacementNotice.js +22 -0
- package/dist/puck/editor/QuickTestActions.d.ts +6 -0
- package/dist/puck/editor/QuickTestActions.js +57 -0
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +10 -6
- package/dist/puck/editor/VersionBuilder.d.ts +66 -12
- package/dist/puck/editor/VersionBuilder.js +554 -231
- package/dist/puck/editor/armWrites.d.ts +11 -2
- package/dist/puck/editor/armWrites.js +43 -4
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -4
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/cloneSlot.d.ts +2 -0
- package/dist/puck/editor/cloneSlot.js +7 -0
- package/dist/puck/editor/copy.d.ts +64 -19
- package/dist/puck/editor/copy.js +72 -20
- package/dist/puck/editor/createTest.d.ts +3 -0
- package/dist/puck/editor/createTest.js +33 -0
- package/dist/puck/editor/editor.chrome.css +191 -19
- package/dist/puck/editor/editor.css +328 -24
- package/dist/puck/editor/editor.model.d.ts +17 -1
- package/dist/puck/editor/editor.model.js +61 -4
- package/dist/puck/editor/editorSurface.d.ts +10 -0
- package/dist/puck/editor/editorSurface.js +65 -0
- package/dist/puck/editor/experimentOutlinePlugin.js +96 -28
- package/dist/puck/editor/localPlacements.d.ts +5 -0
- package/dist/puck/editor/localPlacements.js +43 -0
- package/dist/puck/editor/outlineVersion.d.ts +5 -0
- package/dist/puck/editor/outlineVersion.js +36 -0
- package/dist/puck/editor/placementsCache.d.ts +60 -0
- package/dist/puck/editor/placementsCache.js +263 -0
- package/dist/puck/editor/sidebar.d.ts +8 -0
- package/dist/puck/editor/sidebar.js +74 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
- package/dist/puck/editor/usePlacementNotice.js +15 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +105 -86
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -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 +20 -0
- package/dist/puck/visibility.js +81 -0
- 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 +22 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +48 -22
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +8 -8
- 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/{admin → testSurface}/PreviewLinks.js +6 -2
- package/dist/testSurface/actions/DecideDialog.d.ts +16 -0
- package/dist/{admin → testSurface}/actions/DecideDialog.js +78 -55
- package/dist/testSurface/actions/LifecycleAction.d.ts +16 -0
- package/dist/testSurface/actions/LifecycleAction.js +105 -0
- package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +4 -3
- package/dist/{admin → testSurface}/actions/MakeContentResult.js +10 -2
- package/dist/{admin → testSurface}/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +122 -0
- package/dist/{admin → testSurface}/api.d.ts +20 -7
- package/dist/{admin → testSurface}/api.js +72 -22
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/{admin → testSurface}/copy/actions.d.ts +28 -8
- package/dist/{admin → testSurface}/copy/actions.js +31 -11
- package/dist/{admin → testSurface}/copy/common.d.ts +13 -4
- package/dist/{admin → testSurface}/copy/common.js +18 -8
- package/dist/testSurface/copy/languages.d.ts +12 -0
- package/dist/testSurface/copy/languages.js +8 -0
- package/dist/{admin → testSurface}/copy/metrics.d.ts +1 -0
- package/dist/{admin → testSurface}/copy/metrics.js +1 -0
- package/dist/testSurface/copy/pages.d.ts +84 -0
- package/dist/testSurface/copy/pages.js +90 -0
- package/dist/{admin → testSurface}/copy/readiness.d.ts +38 -4
- package/dist/{admin → testSurface}/copy/readiness.js +52 -7
- package/dist/{admin → testSurface}/copy/results.d.ts +6 -3
- package/dist/{admin → testSurface}/copy/results.js +6 -3
- package/dist/{admin → testSurface}/copy/review.d.ts +1 -1
- package/dist/{admin → testSurface}/copy/review.js +1 -1
- package/dist/{admin → testSurface}/copy/surface.d.ts +11 -2
- package/dist/{admin → testSurface}/copy/surface.js +13 -10
- package/dist/{admin → testSurface}/copy/testPage.d.ts +53 -8
- package/dist/testSurface/copy/testPage.js +165 -0
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/{admin → testSurface}/placements/placementLabels.d.ts +2 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +3 -2
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/readPreflight.d.ts +13 -0
- package/dist/testSurface/readPreflight.js +44 -0
- package/dist/testSurface/readinessRead.d.ts +53 -0
- package/dist/testSurface/readinessRead.js +50 -0
- package/dist/{admin → testSurface}/results/VerdictHero.d.ts +2 -1
- package/dist/{admin → testSurface}/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/results/results.model.js +6 -2
- package/dist/{admin → testSurface}/surface/contracts.d.ts +17 -3
- package/dist/testSurface/surface/editorPlacement.d.ts +26 -0
- package/dist/testSurface/surface/editorPlacement.js +78 -0
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +9 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +39 -11
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +13 -0
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +273 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +21 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +503 -0
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -0
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +8 -4
- package/dist/testSurface/surface/readiness/ActionDialogs.js +351 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +2 -3
- package/dist/testSurface/surface/readiness/Banner.js +187 -0
- package/dist/testSurface/surface/readiness/BlockerList.d.ts +11 -0
- package/dist/testSurface/surface/readiness/BlockerList.js +31 -0
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +10 -0
- package/dist/testSurface/surface/readiness/SaveStatus.js +66 -0
- package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -2
- package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +28 -2
- package/dist/testSurface/surface/readiness/readiness.model.js +377 -0
- package/dist/testSurface/surface/readiness/useTransition.d.ts +16 -0
- package/dist/testSurface/surface/readiness/useTransition.js +141 -0
- package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +6 -3
- package/dist/{admin → testSurface}/surface/results/ReleasePages.js +40 -40
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +108 -44
- package/dist/{admin → testSurface}/surface/results/useResults.d.ts +26 -8
- package/dist/{admin → testSurface}/surface/results/useResults.js +3 -2
- package/dist/{admin → testSurface}/surface/setting/parts.js +58 -18
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +2 -0
- package/dist/testSurface/surface/test/DeleteTest.d.ts +23 -0
- package/dist/testSurface/surface/test/DeleteTest.js +270 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +116 -86
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +5 -1
- package/dist/{admin → testSurface}/surface/test/PageHoldout.js +4 -1
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +2 -3
- package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
- package/dist/testSurface/surface/test/Section.js +80 -0
- package/dist/{admin → testSurface}/surface/test/TargetingSection.js +82 -12
- package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
- package/dist/testSurface/surface/test/TestSurface.js +265 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +69 -35
- package/dist/{admin → testSurface}/surface/test/fields.d.ts +30 -7
- package/dist/testSurface/surface/test/fields.js +306 -0
- package/dist/{admin → testSurface}/surface/test/pageParts.js +27 -43
- package/dist/testSurface/surface/test/testPage.css +103 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.js +6 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +3 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +60 -0
- package/dist/testSurface/surface/useTestDocument.js +782 -0
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +7 -0
- package/dist/testSurface/surfaceUrls.js +19 -0
- package/dist/{admin → testSurface}/useApi.d.ts +21 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.d.ts +3 -0
- package/dist/testSurface/useReadinessPolling.js +26 -0
- package/dist/transitions/addMetric.d.ts +2 -5
- package/dist/transitions/addMetric.js +5 -1
- 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 +6 -1
- package/dist/transitions/checkStart.js +133 -17
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +6 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +41 -17
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +32 -0
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -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 +16 -12
- package/dist/transitions/placements.d.ts +54 -8
- package/dist/transitions/placements.js +304 -81
- package/dist/transitions/preflightData.d.ts +5 -3
- package/dist/transitions/preflightData.js +137 -40
- 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 +72 -35
- 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 +15 -3
- package/dist/types/endpoints.d.ts +121 -17
- package/dist/types/puck.d.ts +1 -0
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +9 -9
- package/dist/ui/Button.js +2 -2
- package/dist/ui/Card.d.ts +2 -1
- package/dist/ui/Card.js +4 -4
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +24 -2
- package/dist/ui/Dialog.js +116 -6
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Inputs.d.ts +4 -3
- package/dist/ui/Inputs.js +7 -4
- package/dist/ui/SelectControl.d.ts +33 -0
- package/dist/ui/SelectControl.js +504 -0
- package/dist/ui/Tabs.d.ts +4 -4
- package/dist/ui/Tabs.js +35 -32
- package/dist/ui/ui.css +49 -5
- package/package.json +3 -2
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- package/dist/admin/actions/DecideDialog.d.ts +0 -10
- package/dist/admin/actions/actions.model.js +0 -70
- package/dist/admin/copy/pages.d.ts +0 -26
- package/dist/admin/copy/pages.js +0 -26
- package/dist/admin/copy/testPage.js +0 -104
- package/dist/admin/results/results.css +0 -64
- package/dist/admin/styles.css +0 -10
- package/dist/admin/styles.d.ts +0 -2
- package/dist/admin/styles.js +0 -3
- package/dist/admin/surface/pageBlock/pageBlock.model.js +0 -8
- package/dist/admin/surface/pagePicker/CopyRoute.d.ts +0 -6
- package/dist/admin/surface/pagePicker/CopyRoute.js +0 -53
- package/dist/admin/surface/pagePicker/PagePicker.d.ts +0 -10
- package/dist/admin/surface/pagePicker/PagePicker.js +0 -172
- package/dist/admin/surface/readiness/ActionDialogs.js +0 -337
- package/dist/admin/surface/readiness/Banner.js +0 -190
- package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.js +0 -53
- package/dist/admin/surface/readiness/readiness.model.js +0 -205
- package/dist/admin/surface/readiness/useTransition.d.ts +0 -11
- package/dist/admin/surface/readiness/useTransition.js +0 -35
- package/dist/admin/surface/setting/setting.css +0 -17
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- package/dist/admin/surface/test/LengthSection.d.ts +0 -2
- package/dist/admin/surface/test/Section.js +0 -47
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/fields.js +0 -216
- package/dist/admin/surface/test/testPage.css +0 -97
- package/dist/admin/surface/useTestDocument.d.ts +0 -32
- package/dist/admin/surface/useTestDocument.js +0 -415
- /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
- /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/allocation.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
- /package/dist/{admin → testSurface}/copy/advanced.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
- /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/arms.js +0 -0
- /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/audience.js +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
- /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/setting.js +0 -0
- /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
- /package/dist/{admin → testSurface}/format/date.js +0 -0
- /package/dist/{admin → testSurface}/labels.d.ts +0 -0
- /package/dist/{admin → testSurface}/labels.js +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.model.js +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
- /package/dist/{admin → testSurface}/reload.d.ts +0 -0
- /package/dist/{admin → testSurface}/reload.js +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
- /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/format.js +0 -0
- /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/legacy.js +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
- /package/dist/{admin → testSurface}/results/results.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
- /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/review/review.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
- /package/dist/{admin → testSurface}/theme.d.ts +0 -0
- /package/dist/{admin → testSurface}/theme.js +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { Button } from '../../ui/Button.js';
|
|
5
|
+
import { AddMetricAction, AllocateAction, ConfirmAction } from '../surface/readiness/ActionDialogs.js';
|
|
6
|
+
import { ReleasePagesDialog } from '../surface/results/ReleasePages.js';
|
|
7
|
+
import { actionGroupLabel, availableActions } from './actions.model.js';
|
|
8
|
+
import { DecideDialog } from './DecideDialog.js';
|
|
9
|
+
export function LifecycleButton({ action, reason, showReason = true, disabled, busy, onClick }) {
|
|
10
|
+
const id = useId();
|
|
11
|
+
const help = showReason ? reason ?? action.hint : action.hint;
|
|
12
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
13
|
+
className: "xp-lifecycle-action",
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
16
|
+
variant: action.tone === 'danger' ? 'danger' : action.tone === 'primary' ? 'primary' : 'secondary',
|
|
17
|
+
busy: busy,
|
|
18
|
+
disabled: disabled || !!reason,
|
|
19
|
+
"aria-describedby": help ? id : undefined,
|
|
20
|
+
title: !showReason ? reason : undefined,
|
|
21
|
+
onClick: (event)=>{
|
|
22
|
+
event.currentTarget.focus();
|
|
23
|
+
onClick();
|
|
24
|
+
},
|
|
25
|
+
children: action.label
|
|
26
|
+
}),
|
|
27
|
+
help ? /*#__PURE__*/ _jsx("span", {
|
|
28
|
+
className: "xp-ui-help",
|
|
29
|
+
id: id,
|
|
30
|
+
children: help
|
|
31
|
+
}) : null
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function LifecycleDialog({ action, test, surface, onClose }) {
|
|
36
|
+
const [opened] = useState(test.doc);
|
|
37
|
+
const doc = test.doc ?? opened;
|
|
38
|
+
const decision = doc.decision;
|
|
39
|
+
const winner = actionGroupLabel(decision?.winnerArm ?? 'control', doc.arms.find((arm)=>arm.key === decision?.winnerArm)?.label);
|
|
40
|
+
const props = {
|
|
41
|
+
test,
|
|
42
|
+
surface,
|
|
43
|
+
onClose
|
|
44
|
+
};
|
|
45
|
+
const changed = !test.doc || doc.phase !== opened.phase || !availableActions({
|
|
46
|
+
...doc,
|
|
47
|
+
decision,
|
|
48
|
+
canManage: surface.canManage,
|
|
49
|
+
canReadResults: surface.canReadResults
|
|
50
|
+
}).some((item)=>item.id === action.id);
|
|
51
|
+
if (action.id === 'decide') return /*#__PURE__*/ _jsx(DecideDialog, {
|
|
52
|
+
name: opened.name,
|
|
53
|
+
id: opened.id,
|
|
54
|
+
phase: opened.phase,
|
|
55
|
+
checks: test.preflight?.checks,
|
|
56
|
+
apiRoute: surface.apiRoute,
|
|
57
|
+
pending: test.statusReadPending,
|
|
58
|
+
unavailable: changed,
|
|
59
|
+
onClose: onClose,
|
|
60
|
+
onRefusal: ()=>{
|
|
61
|
+
void test.reload();
|
|
62
|
+
},
|
|
63
|
+
onSuccess: (result)=>{
|
|
64
|
+
test.acceptTransition?.({
|
|
65
|
+
doc: result
|
|
66
|
+
});
|
|
67
|
+
onClose();
|
|
68
|
+
void test.reload();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
if (action.id === 'release-pages') return /*#__PURE__*/ _jsx(ReleasePagesDialog, {
|
|
72
|
+
name: opened.name,
|
|
73
|
+
id: opened.id,
|
|
74
|
+
phase: opened.phase,
|
|
75
|
+
apiRoute: surface.apiRoute,
|
|
76
|
+
disabled: test.statusReadPending || changed,
|
|
77
|
+
onClose: onClose,
|
|
78
|
+
onRefusal: (status)=>{
|
|
79
|
+
if ([
|
|
80
|
+
401,
|
|
81
|
+
403,
|
|
82
|
+
404,
|
|
83
|
+
409,
|
|
84
|
+
422
|
|
85
|
+
].includes(status)) void test.reload();
|
|
86
|
+
},
|
|
87
|
+
onSuccess: (doc)=>{
|
|
88
|
+
test.acceptTransition?.({
|
|
89
|
+
doc
|
|
90
|
+
});
|
|
91
|
+
void test.reload();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (action.id === 'allocate') return /*#__PURE__*/ _jsx(AllocateAction, {
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
if (action.id === 'add-metric') return /*#__PURE__*/ _jsx(AddMetricAction, {
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/ _jsx(ConfirmAction, {
|
|
101
|
+
...props,
|
|
102
|
+
action: action,
|
|
103
|
+
winnerLabel: winner
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocId } from '../../types/contracts.js';
|
|
2
|
-
import type { MakeContentResult as Result } from '../../types/endpoints.js';
|
|
3
|
-
import type { createApi } from '../api.js';
|
|
2
|
+
import type { DismissContentEntryResult, MakeContentResult as Result } from '../../types/endpoints.js';
|
|
3
|
+
import type { ApiResult, createApi } from '../api.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
result: Result;
|
|
6
6
|
onRetry: () => void | Promise<void>;
|
|
@@ -12,6 +12,7 @@ type Props = {
|
|
|
12
12
|
onFinish?: () => void | Promise<void>;
|
|
13
13
|
onBusyChange?: (busy: boolean) => void;
|
|
14
14
|
onActionStart?: () => void;
|
|
15
|
+
onDocumentChange?: (result: ApiResult<DismissContentEntryResult>) => void | Promise<void>;
|
|
15
16
|
};
|
|
16
|
-
export declare function MakeContentResult({ result, onRetry, busy, id, api, canManage, isDecided, onFinish, onBusyChange, onActionStart }: Props): import("react").JSX.Element;
|
|
17
|
+
export declare function MakeContentResult({ result, onRetry, busy, id, api, canManage, isDecided, onFinish, onBusyChange, onActionStart, onDocumentChange }: Props): import("react").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -6,7 +6,7 @@ import { Button } from '../../ui/Button.js';
|
|
|
6
6
|
import { Banner } from '../../ui/Banner.js';
|
|
7
7
|
import { API_MESSAGES } from '../copy/common.js';
|
|
8
8
|
import { ACTIONS_COPY as C, contentReportCopy } from '../copy/actions.js';
|
|
9
|
-
export function MakeContentResult({ result, onRetry, busy = false, id, api, canManage = false, isDecided = false, onFinish, onBusyChange, onActionStart }) {
|
|
9
|
+
export function MakeContentResult({ result, onRetry, busy = false, id, api, canManage = false, isDecided = false, onFinish, onBusyChange, onActionStart, onDocumentChange }) {
|
|
10
10
|
const inFlight = useRef(false);
|
|
11
11
|
const container = useRef(null);
|
|
12
12
|
const focusTarget = useRef(null);
|
|
@@ -58,8 +58,16 @@ export function MakeContentResult({ result, onRetry, busy = false, id, api, canM
|
|
|
58
58
|
});
|
|
59
59
|
if (!response.ok) {
|
|
60
60
|
setError(response.message);
|
|
61
|
+
if ([
|
|
62
|
+
401,
|
|
63
|
+
403,
|
|
64
|
+
404,
|
|
65
|
+
409,
|
|
66
|
+
422
|
|
67
|
+
].includes(response.status)) await onDocumentChange?.(response);
|
|
61
68
|
return;
|
|
62
69
|
}
|
|
70
|
+
await onDocumentChange?.(response);
|
|
63
71
|
const decision = response.data?.doc.decision;
|
|
64
72
|
const updated = decision?.contentReport?.docs?.find((doc)=>doc.collection === entry.collection && String(doc.id) === String(entry.id));
|
|
65
73
|
if (!updated) {
|
|
@@ -137,7 +145,7 @@ export function MakeContentResult({ result, onRetry, busy = false, id, api, canM
|
|
|
137
145
|
}) : null,
|
|
138
146
|
editable && contentDone(docs) && onFinish ? /*#__PURE__*/ _jsx(Button, {
|
|
139
147
|
"data-finish-archiving": true,
|
|
140
|
-
variant: "
|
|
148
|
+
variant: "danger",
|
|
141
149
|
disabled: busy || pending,
|
|
142
150
|
onClick: ()=>{
|
|
143
151
|
void run(onFinish);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { ExperimentKind, Status } from '../../types/contracts.js';
|
|
2
2
|
import type { ArchiveBody, ContentReport } from '../../types/endpoints.js';
|
|
3
|
+
import { type PageReleaseDecision } from '../results/releasePages.model.js';
|
|
3
4
|
export type ActionGroup = {
|
|
4
5
|
key: string;
|
|
5
6
|
label?: string;
|
|
6
7
|
kind?: string;
|
|
7
8
|
};
|
|
8
9
|
export type { ContentReport } from '../../types/endpoints.js';
|
|
9
|
-
export type ActionDecision = {
|
|
10
|
-
winnerArm?: string | null;
|
|
10
|
+
export type ActionDecision = PageReleaseDecision & {
|
|
11
11
|
holdoutReleasedAt?: string | null;
|
|
12
12
|
contentReport?: ContentReport | null;
|
|
13
13
|
};
|
|
14
|
-
export type ActionId = 'start' | 'stop' | 'decide' | 'release-holdout' | 'make-content' | 'after-content' | 'archive' | 'discard' | 'hard-coded' | 'allocate' | 'add-metric';
|
|
14
|
+
export type ActionId = 'start' | 'stop' | 'decide' | 'release-holdout' | 'make-content' | 'after-content' | 'archive' | 'discard' | 'hard-coded' | 'allocate' | 'add-metric' | 'delete' | 'release-pages';
|
|
15
|
+
export declare function isDestructiveAction(id: ActionId): boolean;
|
|
15
16
|
export type ExperimentAction = {
|
|
16
17
|
id: ActionId;
|
|
17
18
|
label: string;
|
|
@@ -19,17 +20,24 @@ export type ExperimentAction = {
|
|
|
19
20
|
confirm: {
|
|
20
21
|
title: string;
|
|
21
22
|
body: string;
|
|
23
|
+
label?: string;
|
|
22
24
|
phrase?: {
|
|
23
25
|
action: 'discard' | 'hard-coded';
|
|
24
26
|
};
|
|
25
27
|
};
|
|
26
28
|
archive?: ArchiveBody;
|
|
29
|
+
hint?: string;
|
|
30
|
+
unavailable?: string;
|
|
27
31
|
};
|
|
28
32
|
export declare function actionGroupLabel(key: string, storedLabel?: string): string;
|
|
29
|
-
export declare function
|
|
33
|
+
export declare function canDeleteTest(status: string): status is "draft" | "archived";
|
|
34
|
+
export declare function availableActions({ name, status, kind, arms, allocation, decision, canManage, canReadResults }: {
|
|
35
|
+
name?: string;
|
|
30
36
|
status: Status;
|
|
31
37
|
kind: ExperimentKind;
|
|
32
|
-
arms
|
|
38
|
+
arms?: readonly ActionGroup[] | null;
|
|
39
|
+
allocation?: number;
|
|
33
40
|
decision?: ActionDecision | null;
|
|
34
41
|
canManage: boolean;
|
|
42
|
+
canReadResults?: boolean;
|
|
35
43
|
}): ExperimentAction[];
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { contentDone } from '../../contentDone.js';
|
|
2
|
+
import { armLabel } from '../labels.js';
|
|
3
|
+
import { ACTIONS_COPY as C, actionTitle, hardCodedLabel, makeContentCopy, releaseCopy } from '../copy/actions.js';
|
|
4
|
+
import { REVIEW_COPY } from '../copy/review.js';
|
|
5
|
+
import { READINESS_COPY } from '../copy/readiness.js';
|
|
6
|
+
import { DELETE_TEST } from '../copy/testPage.js';
|
|
7
|
+
import { RESULTS_COPY } from '../copy/results.js';
|
|
8
|
+
import { canReleasePages } from '../results/releasePages.model.js';
|
|
9
|
+
const destructiveActions = new Set([
|
|
10
|
+
'stop',
|
|
11
|
+
'decide',
|
|
12
|
+
'release-holdout',
|
|
13
|
+
'make-content',
|
|
14
|
+
'after-content',
|
|
15
|
+
'archive',
|
|
16
|
+
'discard',
|
|
17
|
+
'hard-coded',
|
|
18
|
+
'delete',
|
|
19
|
+
'release-pages'
|
|
20
|
+
]);
|
|
21
|
+
// Use destructive confirmation styling when an action permanently ends a round, ships or releases content, archives, or deletes.
|
|
22
|
+
export function isDestructiveAction(id) {
|
|
23
|
+
return destructiveActions.has(id);
|
|
24
|
+
}
|
|
25
|
+
export function actionGroupLabel(key, storedLabel) {
|
|
26
|
+
return storedLabel?.trim() || armLabel(key);
|
|
27
|
+
}
|
|
28
|
+
export function canDeleteTest(status) {
|
|
29
|
+
return status === 'draft' || status === 'archived';
|
|
30
|
+
}
|
|
31
|
+
export function availableActions({ name, status, kind, arms = [], allocation, decision, canManage, canReadResults = canManage }) {
|
|
32
|
+
if (!canManage) return [];
|
|
33
|
+
const action = (id, label, body, tone = 'secondary', archive, phrase)=>{
|
|
34
|
+
const confirmLabel = id === 'hard-coded' ? C.confirmPermanentWinner : label;
|
|
35
|
+
const titleKey = id === 'start' && status === 'stopped' ? 'restart' : id;
|
|
36
|
+
const titleLead = Object.hasOwn(C.titleLead, titleKey) ? C.titleLead[titleKey] : confirmLabel;
|
|
37
|
+
return {
|
|
38
|
+
id,
|
|
39
|
+
label,
|
|
40
|
+
tone,
|
|
41
|
+
confirm: {
|
|
42
|
+
title: name ? actionTitle(titleLead, name) : confirmLabel,
|
|
43
|
+
label: confirmLabel,
|
|
44
|
+
body,
|
|
45
|
+
...phrase ? {
|
|
46
|
+
phrase: {
|
|
47
|
+
action: phrase
|
|
48
|
+
}
|
|
49
|
+
} : {}
|
|
50
|
+
},
|
|
51
|
+
...archive ? {
|
|
52
|
+
archive
|
|
53
|
+
} : {}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const start = action('start', status === 'stopped' ? C.restart : C.start, status === 'stopped' ? C.restartBody : C.startBody, 'primary');
|
|
57
|
+
const decide = canReadResults ? [
|
|
58
|
+
action('decide', C.decide, C.decideBody, 'primary')
|
|
59
|
+
] : [];
|
|
60
|
+
const remove = action('delete', DELETE_TEST.action, DELETE_TEST.consequences, 'danger');
|
|
61
|
+
if (canDeleteTest(status)) return status === 'draft' ? [
|
|
62
|
+
start,
|
|
63
|
+
remove
|
|
64
|
+
] : [
|
|
65
|
+
...canReleasePages({
|
|
66
|
+
status,
|
|
67
|
+
kind,
|
|
68
|
+
decision
|
|
69
|
+
}) ? [
|
|
70
|
+
action('release-pages', RESULTS_COPY.releasePages, RESULTS_COPY.releasePagesBody)
|
|
71
|
+
] : [],
|
|
72
|
+
remove
|
|
73
|
+
];
|
|
74
|
+
if (status === 'running') return [
|
|
75
|
+
action('stop', C.stop, C.stopBody, 'danger'),
|
|
76
|
+
...decide,
|
|
77
|
+
action('add-metric', READINESS_COPY.addGoal, ''),
|
|
78
|
+
{
|
|
79
|
+
...action('allocate', READINESS_COPY.allocate, REVIEW_COPY.allocationBody),
|
|
80
|
+
unavailable: allocation !== undefined && allocation >= 100 ? READINESS_COPY.everyone : undefined
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
if (status === 'stopped') return [
|
|
84
|
+
start,
|
|
85
|
+
...decide,
|
|
86
|
+
{
|
|
87
|
+
...action('archive', C.archive, C.archiveBody, 'secondary', {
|
|
88
|
+
mode: 'stopped'
|
|
89
|
+
}),
|
|
90
|
+
hint: DELETE_TEST.archiveFirst
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
if (status !== 'decided') return [];
|
|
94
|
+
const groups = arms ?? [];
|
|
95
|
+
const winner = groups.find((group)=>group.key === decision?.winnerArm);
|
|
96
|
+
const label = actionGroupLabel(decision?.winnerArm ?? 'control', winner?.label);
|
|
97
|
+
const rolloutOpen = groups.some((group)=>group.key === 'holdout') && Boolean(decision?.winnerArm) && decision?.winnerArm !== 'control' && !decision?.holdoutReleasedAt;
|
|
98
|
+
const actions = [
|
|
99
|
+
...rolloutOpen ? [
|
|
100
|
+
action('release-holdout', C.release, releaseCopy(label))
|
|
101
|
+
] : [],
|
|
102
|
+
...kind !== 'code' ? [
|
|
103
|
+
action('make-content', C.makeContent, makeContentCopy(label, kind), 'primary')
|
|
104
|
+
] : [],
|
|
105
|
+
...contentDone(decision?.contentReport) ? [
|
|
106
|
+
action('after-content', C.finish, C.finishBody, 'secondary', {
|
|
107
|
+
mode: 'after-content'
|
|
108
|
+
})
|
|
109
|
+
] : [],
|
|
110
|
+
action('discard', C.discard, C.discardBody, 'danger', {
|
|
111
|
+
mode: 'discard'
|
|
112
|
+
}, 'discard'),
|
|
113
|
+
...kind === 'code' && winner && winner.kind !== 'holdout' ? [
|
|
114
|
+
action('hard-coded', hardCodedLabel(label), C.hardCodedBody, 'primary', {
|
|
115
|
+
mode: 'hard-coded'
|
|
116
|
+
}, 'hard-coded')
|
|
117
|
+
] : []
|
|
118
|
+
];
|
|
119
|
+
const archiveOption = actions.find((item)=>item.id === 'after-content') ?? actions.find((item)=>item.archive || item.id === 'make-content');
|
|
120
|
+
if (archiveOption) archiveOption.hint = DELETE_TEST.archiveFirst;
|
|
121
|
+
return actions;
|
|
122
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocId } from '../types/contracts.js';
|
|
2
|
-
import type { WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
|
|
2
|
+
import type { CopyPagePlan, CopyPageResult, DeleteImpactResult, WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
|
|
3
3
|
import { refusalMessage } from './copy/common.js';
|
|
4
4
|
export type ApiResult<T> = {
|
|
5
5
|
ok: true;
|
|
@@ -12,27 +12,40 @@ export type ApiResult<T> = {
|
|
|
12
12
|
retryable: boolean;
|
|
13
13
|
};
|
|
14
14
|
type RequestOptions = NonNullable<Parameters<typeof refusalMessage>[3]>;
|
|
15
|
-
export declare function createApi(apiBase: string): {
|
|
15
|
+
export declare function createApi(apiBase: string, contentLocale?: string): {
|
|
16
|
+
findTestIdBySlug: (slug: string) => Promise<Extract<ApiResult<DocId>, {
|
|
17
|
+
ok: false;
|
|
18
|
+
}> | {
|
|
19
|
+
ok: true;
|
|
20
|
+
data: DocId;
|
|
21
|
+
}>;
|
|
22
|
+
deleteTest: (id: DocId, { draft }?: {
|
|
23
|
+
draft?: boolean;
|
|
24
|
+
}) => Promise<ApiResult<unknown>>;
|
|
16
25
|
wrapBlock: (body: WrapBlockBody) => Promise<ApiResult<Record<string, unknown>>>;
|
|
17
26
|
pages: (query: {
|
|
18
27
|
collection: string;
|
|
19
28
|
q?: string;
|
|
20
29
|
path?: string;
|
|
21
30
|
page?: number;
|
|
31
|
+
mode?: "block";
|
|
22
32
|
}, signal?: AbortSignal) => Promise<ApiResult<PagesResult>>;
|
|
33
|
+
previewPageCopy: (id: DocId, arm: string, signal?: AbortSignal) => Promise<ApiResult<CopyPagePlan>>;
|
|
34
|
+
makePageCopy: (id: DocId, arm: string, plan: CopyPagePlan) => Promise<ApiResult<CopyPageResult>>;
|
|
23
35
|
placementStatus: (body: PlacementStatusBody) => Promise<ApiResult<PlacementStatusResult>>;
|
|
24
|
-
start: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
36
|
+
start: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
25
37
|
allocate: (id: DocId, body: AllocateBody, options?: RequestOptions) => Promise<ApiResult<TransitionSuccess>>;
|
|
26
38
|
addMetric: (id: DocId, body: AddMetricBody, options?: RequestOptions) => Promise<ApiResult<AddMetricResult>>;
|
|
27
|
-
stop: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
39
|
+
stop: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
28
40
|
decide: (id: DocId, body: DecideBody) => Promise<ApiResult<TransitionSuccess>>;
|
|
29
|
-
releaseHoldout: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
30
|
-
releasePages: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
31
|
-
makeContent: (id: DocId) => Promise<ApiResult<MakeContentResult>>;
|
|
41
|
+
releaseHoldout: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
42
|
+
releasePages: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
43
|
+
makeContent: (id: DocId, phase?: number) => Promise<ApiResult<MakeContentResult>>;
|
|
32
44
|
dismissContentEntry: (id: DocId, body: DismissContentEntryBody) => Promise<ApiResult<DismissContentEntryResult>>;
|
|
33
45
|
restoreContentEntry: (id: DocId, body: RestoreContentEntryBody) => Promise<ApiResult<RestoreContentEntryResult>>;
|
|
34
46
|
archive: (id: DocId, body: ArchiveBody) => Promise<ApiResult<TransitionSuccess>>;
|
|
35
47
|
clickKeys: (id: DocId) => Promise<ApiResult<ClickKeysResult>>;
|
|
48
|
+
deleteImpact: (id: DocId, signal?: AbortSignal) => Promise<ApiResult<DeleteImpactResult>>;
|
|
36
49
|
preflight: (id: DocId) => Promise<ApiResult<PreflightResult>>;
|
|
37
50
|
previewToken: (id: DocId, arm: string) => Promise<ApiResult<PreviewTokenResult>>;
|
|
38
51
|
results: (id: DocId, options?: {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { XP_IF_UPDATED_AT_HEADER } from '../constants.js';
|
|
2
|
+
import { contentLocaleURL } from './contentLocaleURL.js';
|
|
1
3
|
import { API_MESSAGES, refusalMessage } from './copy/common.js';
|
|
2
4
|
import { CONTENT_ENTRY_REFUSALS } from './copy/actions.js';
|
|
3
|
-
export function createApi(apiBase) {
|
|
5
|
+
export function createApi(apiBase, contentLocale) {
|
|
6
|
+
const collectionBase = `${apiBase.replace(/\/$/, '')}/xp-experiments`;
|
|
4
7
|
const base = `${apiBase.replace(/\/$/, '')}/xp/experiments`;
|
|
5
8
|
const route = (id, action)=>`${base}/${encodeURIComponent(id)}/${action}`;
|
|
6
|
-
async function request(path, method, body, options, signal) {
|
|
9
|
+
async function request(path, method, body, options, signal, updatedAt) {
|
|
7
10
|
try {
|
|
8
11
|
const response = await fetch(path(), {
|
|
9
12
|
method,
|
|
@@ -13,7 +16,10 @@ export function createApi(apiBase) {
|
|
|
13
16
|
} : {},
|
|
14
17
|
...body === undefined ? {} : {
|
|
15
18
|
headers: {
|
|
16
|
-
'Content-Type': 'application/json'
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...updatedAt ? {
|
|
21
|
+
[XP_IF_UPDATED_AT_HEADER]: updatedAt
|
|
22
|
+
} : {}
|
|
17
23
|
},
|
|
18
24
|
body: JSON.stringify(body)
|
|
19
25
|
}
|
|
@@ -50,7 +56,7 @@ export function createApi(apiBase) {
|
|
|
50
56
|
...code ? {
|
|
51
57
|
code
|
|
52
58
|
} : {},
|
|
53
|
-
message: refusalMessage(code, response.status, typeof error?.message === 'string' ? error.message : undefined, options),
|
|
59
|
+
message: refusalMessage(code, response.status, typeof error?.message === 'string' ? error.message : undefined, options, error?.detail),
|
|
54
60
|
retryable: code === 'page-busy' || code === 'commit-unverified' || response.status >= 500 && response.status !== 501
|
|
55
61
|
};
|
|
56
62
|
} catch {
|
|
@@ -64,33 +70,77 @@ export function createApi(apiBase) {
|
|
|
64
70
|
}
|
|
65
71
|
const post = (id, action, body, options)=>request(()=>route(id, action), 'POST', body, options);
|
|
66
72
|
return {
|
|
73
|
+
findTestIdBySlug: async (slug)=>{
|
|
74
|
+
const result = await request(()=>`${collectionBase}?where[slug][equals]=${encodeURIComponent(slug)}&depth=0&limit=1`, 'GET');
|
|
75
|
+
if (!result.ok) return result;
|
|
76
|
+
const id = result.data?.docs?.[0]?.id;
|
|
77
|
+
if (id === undefined) return {
|
|
78
|
+
ok: false,
|
|
79
|
+
status: 404,
|
|
80
|
+
code: 'not-found',
|
|
81
|
+
message: refusalMessage('not-found', 404, undefined, {
|
|
82
|
+
notFound: API_MESSAGES.testAlreadyDeleted
|
|
83
|
+
}),
|
|
84
|
+
retryable: false
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
ok: true,
|
|
88
|
+
data: id
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
deleteTest: (id, { draft = false } = {})=>request(()=>`${collectionBase}/${encodeURIComponent(id)}`, 'DELETE', undefined, {
|
|
92
|
+
notFound: API_MESSAGES.testAlreadyDeleted,
|
|
93
|
+
codes: {
|
|
94
|
+
'invalid-status': draft ? API_MESSAGES.testNoLongerDraft : API_MESSAGES.deleteInvalidStatus
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
67
97
|
wrapBlock: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/blocks/wrap`, 'POST', body),
|
|
68
|
-
pages: (query, signal)=>request(()
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
pages: (query, signal)=>request(()=>{
|
|
99
|
+
const params = new URLSearchParams({
|
|
100
|
+
collection: query.collection
|
|
101
|
+
});
|
|
102
|
+
if (query.q) params.set('q', query.q);
|
|
103
|
+
if (query.path !== undefined) params.set('path', query.path);
|
|
104
|
+
if (query.page) params.set('page', String(query.page));
|
|
105
|
+
if (query.mode) params.set('mode', query.mode);
|
|
106
|
+
if (contentLocale) params.set('locale', contentLocale);
|
|
107
|
+
return `${apiBase.replace(/\/$/, '')}/xp/pages?${params}`;
|
|
108
|
+
}, 'GET', undefined, undefined, signal),
|
|
109
|
+
previewPageCopy: (id, arm, signal)=>request(()=>`${route(id, 'duplicate-original')}?arm=${encodeURIComponent(arm)}`, 'GET', undefined, undefined, signal),
|
|
110
|
+
makePageCopy: (id, arm, plan)=>request(()=>route(id, 'duplicate-original'), 'POST', {
|
|
111
|
+
...plan,
|
|
112
|
+
arm
|
|
113
|
+
}, undefined, undefined, plan.updatedAt),
|
|
80
114
|
placementStatus: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/placements/status`, 'POST', body),
|
|
81
|
-
start: (id)=>post(id, 'start'
|
|
115
|
+
start: (id, phase)=>post(id, 'start', phase === undefined ? undefined : {
|
|
116
|
+
phase
|
|
117
|
+
}),
|
|
82
118
|
allocate: (id, body, options)=>post(id, 'allocate', body, options),
|
|
83
119
|
addMetric: (id, body, options)=>post(id, 'add-metric', body, options),
|
|
84
|
-
stop: (id)=>post(id, 'stop'
|
|
120
|
+
stop: (id, phase)=>post(id, 'stop', phase === undefined ? undefined : {
|
|
121
|
+
phase
|
|
122
|
+
}),
|
|
85
123
|
decide: (id, body)=>post(id, 'decide', body),
|
|
86
|
-
releaseHoldout: (id)=>post(id, 'release-holdout'
|
|
87
|
-
|
|
88
|
-
|
|
124
|
+
releaseHoldout: (id, phase)=>post(id, 'release-holdout', phase === undefined ? undefined : {
|
|
125
|
+
phase
|
|
126
|
+
}),
|
|
127
|
+
releasePages: (id, phase)=>post(id, 'release-pages', phase === undefined ? undefined : {
|
|
128
|
+
phase
|
|
129
|
+
}),
|
|
130
|
+
makeContent: (id, phase)=>post(id, 'make-content', phase === undefined ? undefined : {
|
|
131
|
+
phase
|
|
132
|
+
}),
|
|
89
133
|
dismissContentEntry: (id, body)=>post(id, 'content-report/dismiss', body, CONTENT_ENTRY_REFUSALS),
|
|
90
134
|
restoreContentEntry: (id, body)=>post(id, 'content-report/restore', body, CONTENT_ENTRY_REFUSALS),
|
|
91
135
|
archive: (id, body)=>post(id, 'archive', body),
|
|
92
136
|
clickKeys: (id)=>request(()=>route(id, 'click-keys'), 'GET'),
|
|
93
|
-
|
|
137
|
+
deleteImpact: (id, signal)=>request(()=>contentLocaleURL(route(id, 'delete-impact'), contentLocale), 'GET', undefined, {
|
|
138
|
+
codes: {
|
|
139
|
+
'invalid-status': API_MESSAGES.deleteInvalidStatus
|
|
140
|
+
},
|
|
141
|
+
fallback: API_MESSAGES.deleteImpactUnavailable
|
|
142
|
+
}, signal),
|
|
143
|
+
preflight: (id)=>request(()=>contentLocaleURL(route(id, 'preflight'), contentLocale), 'GET'),
|
|
94
144
|
previewToken: (id, arm)=>request(()=>`${route(id, 'preview-token')}?arm=${encodeURIComponent(arm)}`, 'GET'),
|
|
95
145
|
results: (id, options = {})=>request(()=>{
|
|
96
146
|
const query = new URLSearchParams();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AddMetricWarning } from '../../types/endpoints.js';
|
|
2
2
|
export declare const ACTIONS_COPY: {
|
|
3
|
+
readonly decisionUnavailable: "This round can no longer be decided here. Copy your note before closing.";
|
|
3
4
|
readonly start: "Start";
|
|
4
5
|
readonly restart: "Start a new round";
|
|
5
6
|
readonly stop: "Stop";
|
|
@@ -9,13 +10,29 @@ export declare const ACTIONS_COPY: {
|
|
|
9
10
|
readonly finish: "Finish archiving";
|
|
10
11
|
readonly archive: "Archive";
|
|
11
12
|
readonly discard: "Discard winner";
|
|
12
|
-
readonly startBody: "
|
|
13
|
-
readonly restartBody: "
|
|
14
|
-
readonly stopBody: "
|
|
13
|
+
readonly startBody: "The test will start showing versions to visitors and collecting results.";
|
|
14
|
+
readonly restartBody: "Visitors will start seeing test versions again. New results go into a new round, and earlier results are kept.";
|
|
15
|
+
readonly stopBody: "Visitors will go back to the Original. The test stops collecting data and keeps its results. Starting again begins a new round.";
|
|
15
16
|
readonly original: "Everyone will see the Original.";
|
|
16
|
-
readonly discardBody: "
|
|
17
|
-
readonly archiveBody: "
|
|
18
|
-
readonly finishBody: "The content
|
|
17
|
+
readonly discardBody: "Visitors go back to the Original. The test moves to Archived and keeps its results and decision note. You can then delete it.";
|
|
18
|
+
readonly archiveBody: "The test moves out of the active list into Archived. It won't collect any more data, and visitors will keep seeing the Original. You can still view the results or delete the test later. You can't restart it.";
|
|
19
|
+
readonly finishBody: "The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.";
|
|
20
|
+
readonly hardCodedBody: "The test moves to Archived and keeps its results. The site will use the version your developer made permanent. You can then delete the test.";
|
|
21
|
+
readonly confirmPermanentWinner: "Confirm permanent winner";
|
|
22
|
+
readonly titleLead: {
|
|
23
|
+
readonly restart: "Start a new round for";
|
|
24
|
+
readonly decide: "Decide the winner for";
|
|
25
|
+
readonly 'release-holdout': "Release the holdout for";
|
|
26
|
+
readonly 'make-content': "Make the winner permanent for";
|
|
27
|
+
readonly discard: "Discard the winner for";
|
|
28
|
+
readonly 'hard-coded': "Confirm the permanent winner for";
|
|
29
|
+
readonly allocate: "Let more people into";
|
|
30
|
+
readonly 'add-metric': "Add a goal to";
|
|
31
|
+
readonly 'release-pages': "Release pages for";
|
|
32
|
+
};
|
|
33
|
+
readonly decideBody: "Choose the version visitors should see going forward. The test round ends and its results are kept.";
|
|
34
|
+
readonly decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.";
|
|
35
|
+
readonly actionChanged: "This test changed. Close this dialog to see the current actions.";
|
|
19
36
|
readonly noResults: "There are no results yet.";
|
|
20
37
|
readonly noRecommendation: "The results don't recommend a group yet.";
|
|
21
38
|
readonly different: "You chose a different group than the results recommend.";
|
|
@@ -32,7 +49,7 @@ export declare const ACTIONS_COPY: {
|
|
|
32
49
|
readonly contentArchived: "The winner is now the content and the test is archived.";
|
|
33
50
|
readonly dismissLabel: (page: string) => string;
|
|
34
51
|
readonly undoLabel: (page: string) => string;
|
|
35
|
-
readonly dismissHelp: "Dismiss
|
|
52
|
+
readonly dismissHelp: "Dismiss each page you plan to update by hand so you can finish archiving.";
|
|
36
53
|
readonly contentEntryNotDecided: "This test isn't decided, so its pages can't be changed.";
|
|
37
54
|
readonly contentEntryMissing: "This page is no longer in the list. Reload to see the current list.";
|
|
38
55
|
readonly contentEntryDismissed: "This page was already dismissed.";
|
|
@@ -52,8 +69,11 @@ export declare const ACTIONS_COPY: {
|
|
|
52
69
|
'update-failed': string;
|
|
53
70
|
};
|
|
54
71
|
readonly missingContent: "This page no longer exists; nothing to change.";
|
|
55
|
-
readonly partial: "Some pages
|
|
72
|
+
readonly partial: "Some pages still need changes.";
|
|
56
73
|
};
|
|
74
|
+
export declare const actionTitle: (action: string, test: string) => string;
|
|
75
|
+
export declare const actionTitleFor: (action: string, test: string) => string;
|
|
76
|
+
export declare const actionsForTest: (test: string) => string;
|
|
57
77
|
export declare const decideCopy: (winner: string, holdout: boolean, original: boolean) => string;
|
|
58
78
|
export declare const releaseCopy: (winner: string) => string;
|
|
59
79
|
export declare const makeContentCopy: (winner: string, kind: "block" | "page" | "flag") => string;
|