@delmaredigital/payload-experiments 0.4.0-rc.3 → 0.4.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +2 -2
- package/dist/admin/PlacementStatus.js +1 -1
- package/dist/admin/TestsDashboardCards.js +2 -2
- package/dist/admin/TestsNavLink.js +2 -2
- package/dist/admin/blocks/BlockPanel.js +3 -3
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.js +1 -1
- package/dist/admin/blocks/model.js +1 -1
- package/dist/admin/blocks/statusCache.js +1 -1
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +2 -2
- package/dist/admin/copy/blocks.js +3 -2
- package/dist/admin/copy/goals.d.ts +5 -1
- package/dist/admin/copy/goals.js +9 -3
- package/dist/admin/goals/XpGoalField.js +155 -129
- package/dist/admin/goals/xpGoalField.css +2 -3
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +6 -13
- package/dist/admin/surface/SurfaceShell.js +2 -2
- package/dist/admin/surface/TestsHome.d.ts +1 -1
- package/dist/admin/surface/TestsHome.js +3 -3
- package/dist/admin/surface/TestsSurface.js +2 -2
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +55 -7
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +4 -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 +1 -1
- package/dist/admin/surface/home.model.js +5 -5
- package/dist/admin/surface/newTest/NewTest.d.ts +1 -1
- package/dist/admin/surface/newTest/NewTest.js +1 -1
- package/dist/admin/surface/newTest/PageWizard.d.ts +1 -1
- package/dist/admin/surface/newTest/PageWizard.js +23 -25
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +22 -15
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +45 -156
- package/dist/admin/views/ExperimentsRootView.js +1 -1
- package/dist/admin/views/TestsNavLinkServer.js +1 -1
- package/dist/admin/views/renderCollectionList.js +1 -1
- package/dist/admin/views/renderTestsSurface.js +1 -1
- package/dist/blocks/placementLocale.d.ts +21 -0
- package/dist/blocks/placementLocale.js +115 -0
- package/dist/collections/experiments/config.js +1 -1
- package/dist/collections/metrics.js +1 -1
- package/dist/db/bulkPlacementRemoval.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +107 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/index.js +28 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fields/xpGoal.js +1 -1
- package/dist/goals/fairness.d.ts +1 -1
- package/dist/goals/fairness.js +1 -1
- 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 +4 -2
- package/dist/goals/picker/copy.js +4 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/hooks/blockRemovalRule.d.ts +29 -0
- package/dist/hooks/blockRemovalRule.js +141 -0
- package/dist/hooks/pageGuard.d.ts +24 -2
- package/dist/hooks/pageGuard.js +178 -24
- package/dist/lib/placementPages.d.ts +9 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +1 -4
- package/dist/onInit.js +22 -0
- package/dist/plugin.js +2 -1
- package/dist/puck/ExperimentPicker.js +25 -10
- package/dist/puck/copy.d.ts +4 -1
- package/dist/puck/copy.js +4 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +21 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +147 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +11 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +73 -9
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +690 -79
- package/dist/puck/editor/LeftoverVersions.d.ts +13 -0
- package/dist/puck/editor/LeftoverVersions.js +115 -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 +3 -0
- package/dist/puck/editor/QuickTestActions.js +50 -0
- package/dist/puck/editor/ResultsReadout.js +8 -5
- package/dist/puck/editor/VersionBuilder.d.ts +20 -6
- package/dist/puck/editor/VersionBuilder.js +80 -50
- package/dist/puck/editor/armWrites.d.ts +3 -1
- package/dist/puck/editor/armWrites.js +2 -1
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -3
- package/dist/puck/editor/cloneSlot.d.ts +2 -0
- package/dist/puck/editor/cloneSlot.js +7 -0
- package/dist/puck/editor/copy.d.ts +42 -5
- package/dist/puck/editor/copy.js +43 -6
- package/dist/puck/editor/editor.chrome.css +44 -0
- package/dist/puck/editor/editor.css +68 -0
- package/dist/puck/editor/editor.model.d.ts +14 -0
- package/dist/puck/editor/editor.model.js +58 -1
- 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 +2 -0
- package/dist/puck/editor/localPlacements.js +29 -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 +50 -0
- package/dist/puck/editor/placementsCache.js +258 -0
- package/dist/puck/editor/sidebar.d.ts +12 -0
- package/dist/puck/editor/sidebar.js +77 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
- package/dist/puck/editor/usePlacementNotice.js +14 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +109 -98
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -4
- package/dist/{admin → testSurface}/actions/DecideDialog.d.ts +2 -1
- package/dist/{admin → testSurface}/actions/DecideDialog.js +6 -4
- package/dist/{admin → testSurface}/api.js +5 -6
- package/dist/{admin → testSurface}/copy/common.d.ts +3 -1
- package/dist/{admin → testSurface}/copy/common.js +5 -1
- package/dist/{admin → testSurface}/copy/readiness.d.ts +20 -1
- package/dist/{admin → testSurface}/copy/readiness.js +25 -1
- package/dist/{admin → testSurface}/copy/testPage.d.ts +4 -0
- package/dist/{admin → testSurface}/copy/testPage.js +8 -2
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +1 -1
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/readPreflight.d.ts +9 -0
- package/dist/testSurface/readPreflight.js +38 -0
- package/dist/testSurface/readinessRead.d.ts +50 -0
- package/dist/testSurface/readinessRead.js +46 -0
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/surface/contracts.d.ts +7 -2
- package/dist/testSurface/surface/editorPlacement.d.ts +21 -0
- package/dist/testSurface/surface/editorPlacement.js +60 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +19 -9
- package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
- package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.js +37 -7
- package/dist/testSurface/surface/readiness/Banner.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.js +106 -68
- 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 +9 -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 +13 -0
- package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +51 -36
- package/dist/{admin → testSurface}/surface/readiness/useTransition.d.ts +5 -2
- package/dist/testSurface/surface/readiness/useTransition.js +98 -0
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +2 -2
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +18 -11
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +1 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +4 -2
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +2 -1
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +1 -2
- 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 +5 -0
- package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
- package/dist/testSurface/surface/test/TestSurface.js +213 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +13 -6
- package/dist/testSurface/surface/test/testPage.css +104 -0
- package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +9 -2
- package/dist/{admin → testSurface}/surface/useTestDocument.js +92 -46
- package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
- package/dist/testSurface/useReadinessPolling.d.ts +3 -0
- package/dist/testSurface/useReadinessPolling.js +24 -0
- package/dist/transitions/placementInteractions.js +1 -1
- package/dist/transitions/placements.d.ts +27 -8
- package/dist/transitions/placements.js +77 -6
- package/dist/transitions/preflightData.js +1 -1
- package/dist/transitions/start.js +2 -2
- package/dist/types/endpoints.d.ts +1 -1
- package/dist/ui/Card.d.ts +2 -1
- package/dist/ui/Card.js +4 -4
- package/dist/ui/Dialog.d.ts +4 -1
- package/dist/ui/Dialog.js +41 -3
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Tabs.d.ts +4 -3
- package/dist/ui/Tabs.js +47 -32
- package/dist/ui/ui.css +24 -0
- package/package.json +1 -1
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- 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/pagePicker/pagePicker.css +0 -10
- package/dist/admin/surface/readiness/Banner.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.js +0 -53
- 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 -48
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/testPage.css +0 -92
- /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/PreviewLinks.js +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.js +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.js +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}/api.d.ts +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/actions.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/actions.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/metrics.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/metrics.js +0 -0
- /package/dist/{admin → testSurface}/copy/pages.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/pages.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/results.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/results.js +0 -0
- /package/dist/{admin → testSurface}/copy/review.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/review.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}/copy/surface.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/surface.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.d.ts +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/VerdictHero.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/VerdictHero.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/results.model.js +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/pageBlock.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.js +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/results/useResults.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/useResults.js +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.js +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/PageHoldout.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.js +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}/surface/test/pageParts.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.js +0 -0
- /package/dist/{admin → testSurface}/surfaceUrls.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.d.ts +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
3
|
+
import { surfaceUrls } from '../../testSurface/surfaceUrls.js';
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
5
|
import { formatAdminURL } from 'payload/shared';
|
|
6
6
|
import { fetchAllDocs } from '../../lib/fetchAllDocs.js';
|
|
7
|
-
import { createApi } from '
|
|
8
|
-
import { noMatchesLine, SURFACE_COPY } from '
|
|
7
|
+
import { createApi } from '../../testSurface/api.js';
|
|
8
|
+
import { noMatchesLine, SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
9
9
|
import { Banner, EmptyState, StatusChip } from '../../ui/Feedback.js';
|
|
10
10
|
import { Button } from '../../ui/Button.js';
|
|
11
11
|
import { SearchInput } from '../../ui/Inputs.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
3
|
+
import { surfaceUrls } from '../../testSurface/surfaceUrls.js';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { SURFACE_COPY } from '
|
|
5
|
+
import { SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
6
6
|
import { NewTest } from './newTest/NewTest.js';
|
|
7
7
|
import { TestPage } from './test/TestPage.js';
|
|
8
8
|
import { ResultsRoute } from './ResultsRoute.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
3
|
+
import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useRouter } from 'next/navigation.js';
|
|
6
6
|
import { formatAdminURL } from 'payload/shared';
|
|
7
|
-
import { GOALS_COPY as C,
|
|
8
|
-
import { metricSourceHint, metricSourceOptions, sourceFor } from '
|
|
7
|
+
import { GOALS_COPY as C, goalDeleteLockedStart, goalInUse, goalShowAll } from '../../copy/goals.js';
|
|
8
|
+
import { metricSourceHint, metricSourceOptions, sourceFor } from '../../../testSurface/metricSource.model.js';
|
|
9
9
|
import { validateCappingType, validateCappingValue } from '../../../collections/metricValidation.js';
|
|
10
10
|
import { CLICK_KEY } from '../../../goals/key.js';
|
|
11
11
|
import { clickGoalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
12
|
-
import { goalSlug, goalUsage } from './goals.model.js';
|
|
12
|
+
import { goalSlug, goalUsage, goalUsageRows, visibleGoalUsage } from './goals.model.js';
|
|
13
13
|
import { GoalResponseError, goalPages, goalResponse } from './data.js';
|
|
14
|
-
import { SURFACE_COPY } from '
|
|
14
|
+
import { SURFACE_COPY } from '../../../testSurface/copy/surface.js';
|
|
15
15
|
import { SurfaceShell } from '../SurfaceShell.js';
|
|
16
16
|
import { Button } from '../../../ui/Button.js';
|
|
17
17
|
import { TextInput, NumberInput, Select } from '../../../ui/Inputs.js';
|
|
@@ -46,6 +46,8 @@ export function GoalForm({ surface, id, returnToTest }) {
|
|
|
46
46
|
const base = surface.apiRoute.replace(/\/$/, '');
|
|
47
47
|
const [draft, setDraft] = useState(empty);
|
|
48
48
|
const [goal, setGoal] = useState();
|
|
49
|
+
const [usageTests, setUsageTests] = useState([]);
|
|
50
|
+
const [showAllUsage, setShowAllUsage] = useState(false);
|
|
49
51
|
const [usedBy, setUsedBy] = useState(0);
|
|
50
52
|
const [ready, setReady] = useState(false);
|
|
51
53
|
const [loadError, setLoadError] = useState('');
|
|
@@ -81,6 +83,8 @@ export function GoalForm({ surface, id, returnToTest }) {
|
|
|
81
83
|
if (controller.signal.aborted) return;
|
|
82
84
|
const defaultCap = sourceFor(loaded.source, surface.metricSources)?.kind === 'revenue' && loaded.capping?.type == null && loaded.capping?.value == null;
|
|
83
85
|
setGoal(loaded);
|
|
86
|
+
setUsageTests(tests);
|
|
87
|
+
setShowAllUsage(false);
|
|
84
88
|
setUsedBy(goalUsage(tests).get(loaded.id) ?? 0);
|
|
85
89
|
setDraft({
|
|
86
90
|
...empty(),
|
|
@@ -206,6 +210,7 @@ export function GoalForm({ surface, id, returnToTest }) {
|
|
|
206
210
|
setPending(null);
|
|
207
211
|
}
|
|
208
212
|
}
|
|
213
|
+
const usage = goal ? goalUsageRows(usageTests, goal.id) : [];
|
|
209
214
|
const title = goal?.name ?? (id === undefined ? C.newGoal : C.goal);
|
|
210
215
|
return /*#__PURE__*/ _jsx(SurfaceShell, {
|
|
211
216
|
adminRoute: surface.adminRoute,
|
|
@@ -248,6 +253,42 @@ export function GoalForm({ surface, id, returnToTest }) {
|
|
|
248
253
|
void submit();
|
|
249
254
|
},
|
|
250
255
|
children: [
|
|
256
|
+
usage.length ? /*#__PURE__*/ _jsxs(Card, {
|
|
257
|
+
className: "xp-goal-usage",
|
|
258
|
+
id: "xp-goal-usage",
|
|
259
|
+
children: [
|
|
260
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
261
|
+
children: C.usedBy
|
|
262
|
+
}),
|
|
263
|
+
/*#__PURE__*/ _jsx("ul", {
|
|
264
|
+
children: visibleGoalUsage(usage, showAllUsage).map((test)=>/*#__PURE__*/ _jsxs("li", {
|
|
265
|
+
children: [
|
|
266
|
+
/*#__PURE__*/ _jsx("a", {
|
|
267
|
+
href: formatAdminURL({
|
|
268
|
+
adminRoute: surface.adminRoute,
|
|
269
|
+
path: `/experiments/${encodeURIComponent(String(test.id))}`
|
|
270
|
+
}),
|
|
271
|
+
children: test.name
|
|
272
|
+
}),
|
|
273
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
274
|
+
children: [
|
|
275
|
+
test.roles.join(' · '),
|
|
276
|
+
test.status ? ` · ${test.status}` : ''
|
|
277
|
+
]
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}, test.id))
|
|
281
|
+
}),
|
|
282
|
+
usage.length > 5 ? /*#__PURE__*/ _jsx(Button, {
|
|
283
|
+
type: "button",
|
|
284
|
+
variant: "link",
|
|
285
|
+
"aria-expanded": showAllUsage,
|
|
286
|
+
"aria-controls": "xp-goal-usage",
|
|
287
|
+
onClick: ()=>setShowAllUsage((value)=>!value),
|
|
288
|
+
children: showAllUsage ? C.showLess : goalShowAll(usage.length)
|
|
289
|
+
}) : null
|
|
290
|
+
]
|
|
291
|
+
}) : null,
|
|
251
292
|
error ? /*#__PURE__*/ _jsx(Banner, {
|
|
252
293
|
tone: "error",
|
|
253
294
|
children: error
|
|
@@ -493,10 +534,17 @@ export function GoalForm({ surface, id, returnToTest }) {
|
|
|
493
534
|
})
|
|
494
535
|
]
|
|
495
536
|
}),
|
|
496
|
-
id !== undefined && usedBy ? /*#__PURE__*/
|
|
537
|
+
id !== undefined && usedBy ? /*#__PURE__*/ _jsxs("p", {
|
|
497
538
|
className: "xp-ui-help",
|
|
498
539
|
id: "xp-goal-used",
|
|
499
|
-
children:
|
|
540
|
+
children: [
|
|
541
|
+
goalDeleteLockedStart(usedBy),
|
|
542
|
+
/*#__PURE__*/ _jsx("a", {
|
|
543
|
+
href: "#xp-goal-usage",
|
|
544
|
+
children: C.thoseTests
|
|
545
|
+
}),
|
|
546
|
+
C.deleteLockedEnd
|
|
547
|
+
]
|
|
500
548
|
}) : null
|
|
501
549
|
]
|
|
502
550
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
4
|
-
import { sourceFor } from '
|
|
3
|
+
import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
|
|
4
|
+
import { sourceFor } from '../../../testSurface/metricSource.model.js';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
import { formatAdminURL } from 'payload/shared';
|
|
7
7
|
import { Banner, EmptyState } from '../../../ui/Feedback.js';
|
|
8
8
|
import { Button } from '../../../ui/Button.js';
|
|
9
9
|
import { SearchInput } from '../../../ui/Inputs.js';
|
|
10
10
|
import { SurfaceShell } from '../SurfaceShell.js';
|
|
11
|
-
import { SURFACE_COPY } from '
|
|
11
|
+
import { SURFACE_COPY } from '../../../testSurface/copy/surface.js';
|
|
12
12
|
import { GOALS_COPY as C, goalsNoMatches, goalUsedBy } from '../../copy/goals.js';
|
|
13
|
-
import { METRIC_KIND_LABELS } from '
|
|
13
|
+
import { METRIC_KIND_LABELS } from '../../../testSurface/copy/metrics.js';
|
|
14
14
|
import { goalUsage } from './goals.model.js';
|
|
15
15
|
import { goalPages } from './data.js';
|
|
16
16
|
import './goals.css';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocsResponseError, fetchAllDocs } from '../../../lib/fetchAllDocs.js';
|
|
2
|
-
import { refusalMessage } from '
|
|
2
|
+
import { refusalMessage } from '../../../testSurface/copy/common.js';
|
|
3
3
|
import { GOALS_COPY as C } from '../../copy/goals.js';
|
|
4
|
-
import { payloadFieldErrors } from '
|
|
4
|
+
import { payloadFieldErrors } from '../../../testSurface/surface/testDocument.model.js';
|
|
5
5
|
export class GoalResponseError extends Error {
|
|
6
6
|
fields;
|
|
7
7
|
constructor(message, fields){
|
|
@@ -10,3 +10,10 @@
|
|
|
10
10
|
.xp-goal-advanced > summary { padding: var(--xp-space-4); cursor: pointer; font: var(--xp-text-body); }
|
|
11
11
|
.xp-goal-advanced > summary:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
12
12
|
.xp-goal-advanced-fields { display: grid; gap: var(--xp-space-4); padding: 0 var(--xp-space-4) var(--xp-space-4); }
|
|
13
|
+
|
|
14
|
+
.xp-goal-usage { display: grid; gap: var(--xp-space-3); }
|
|
15
|
+
.xp-goal-usage > h2, .xp-goal-usage > ul { margin: 0; }
|
|
16
|
+
.xp-goal-usage > h2 { font: var(--xp-text-title); }
|
|
17
|
+
.xp-goal-usage > ul { display: grid; gap: var(--xp-space-3); padding-inline-start: var(--xp-space-5); }
|
|
18
|
+
.xp-goal-usage li > span { display: block; color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
19
|
+
.xp-goal-usage > .xp-ui-button { justify-self: start; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocId } from '../../../types/contracts.js';
|
|
1
|
+
import type { DocId, Status } from '../../../types/contracts.js';
|
|
2
2
|
export interface Goal {
|
|
3
3
|
id: DocId;
|
|
4
4
|
name: string;
|
|
@@ -18,6 +18,8 @@ type Reference = DocId | {
|
|
|
18
18
|
} | null;
|
|
19
19
|
export interface GoalUsageTest {
|
|
20
20
|
id: DocId;
|
|
21
|
+
name: string;
|
|
22
|
+
status?: Status | null;
|
|
21
23
|
metrics?: {
|
|
22
24
|
primary?: Reference;
|
|
23
25
|
secondary?: Reference[] | null;
|
|
@@ -27,3 +29,11 @@ export interface GoalUsageTest {
|
|
|
27
29
|
/** Count each experiment once per goal, retaining the API's id types. */
|
|
28
30
|
export declare function goalUsage(tests: readonly GoalUsageTest[]): Map<DocId, number>;
|
|
29
31
|
export { goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
32
|
+
/** One row per readable test returned by the API, retaining every role. */
|
|
33
|
+
export declare function goalUsageRows(tests: readonly GoalUsageTest[], goalId: DocId): {
|
|
34
|
+
id: DocId;
|
|
35
|
+
name: string;
|
|
36
|
+
roles: string[];
|
|
37
|
+
status?: string;
|
|
38
|
+
}[];
|
|
39
|
+
export declare function visibleGoalUsage<T>(rows: readonly T[], expanded: boolean): readonly T[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TEST_PAGE } from '../../../testSurface/copy/testPage.js';
|
|
2
|
+
import { statusLabel } from '../../../testSurface/labels.js';
|
|
1
3
|
/** Count each experiment once per goal, retaining the API's id types. */ export function goalUsage(tests) {
|
|
2
4
|
const byGoal = new Map();
|
|
3
5
|
for (const test of tests){
|
|
@@ -22,3 +24,44 @@
|
|
|
22
24
|
]));
|
|
23
25
|
}
|
|
24
26
|
export { goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
27
|
+
const referenceId = (reference)=>reference && typeof reference === 'object' ? reference.id : reference;
|
|
28
|
+
const usageLabels = {
|
|
29
|
+
primary: TEST_PAGE.goal,
|
|
30
|
+
guardrails: TEST_PAGE.guardrailsShort,
|
|
31
|
+
secondary: TEST_PAGE.secondaryShort
|
|
32
|
+
};
|
|
33
|
+
/** One row per readable test returned by the API, retaining every role. */ export function goalUsageRows(tests, goalId) {
|
|
34
|
+
const rows = new Map();
|
|
35
|
+
for (const test of tests){
|
|
36
|
+
const roles = [
|
|
37
|
+
...referenceId(test.metrics?.primary) === goalId ? [
|
|
38
|
+
usageLabels.primary
|
|
39
|
+
] : [],
|
|
40
|
+
...test.metrics?.guardrails?.some((reference)=>referenceId(reference) === goalId) ? [
|
|
41
|
+
usageLabels.guardrails
|
|
42
|
+
] : [],
|
|
43
|
+
...test.metrics?.secondary?.some((reference)=>referenceId(reference) === goalId) ? [
|
|
44
|
+
usageLabels.secondary
|
|
45
|
+
] : []
|
|
46
|
+
];
|
|
47
|
+
if (!roles.length) continue;
|
|
48
|
+
const previous = rows.get(test.id);
|
|
49
|
+
rows.set(test.id, {
|
|
50
|
+
id: test.id,
|
|
51
|
+
name: test.name,
|
|
52
|
+
roles: [
|
|
53
|
+
...new Set([
|
|
54
|
+
...previous?.roles ?? [],
|
|
55
|
+
...roles
|
|
56
|
+
])
|
|
57
|
+
],
|
|
58
|
+
status: test.status ? statusLabel(test.status) : undefined
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return [
|
|
62
|
+
...rows.values()
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
export function visibleGoalUsage(rows, expanded) {
|
|
66
|
+
return expanded ? rows : rows.slice(0, 5);
|
|
67
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Arm, DocId, ExperimentKind, Status, UnitType } from '../../types/contracts.js';
|
|
2
2
|
import type { SummaryResponse } from '../../types/endpoints.js';
|
|
3
|
-
import type { ReadinessContext } from '
|
|
3
|
+
import type { ReadinessContext } from '../../testSurface/surface/readiness/readiness.model.js';
|
|
4
4
|
export interface HomeTest {
|
|
5
5
|
id: DocId;
|
|
6
6
|
name: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { formatAdminURL } from 'payload/shared';
|
|
2
|
-
import { formatDate } from '
|
|
3
|
-
import { armLabel } from '
|
|
2
|
+
import { formatDate } from '../../testSurface/format/date.js';
|
|
3
|
+
import { armLabel } from '../../testSurface/labels.js';
|
|
4
4
|
import { statusPill } from '../status.model.js';
|
|
5
|
-
import { decidedLine, runningLine, SURFACE_COPY } from '
|
|
6
|
-
import { asymmetricGoalsCopy, nextCopy, READINESS_COPY } from '
|
|
7
|
-
import { READINESS } from '
|
|
5
|
+
import { decidedLine, runningLine, SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
6
|
+
import { asymmetricGoalsCopy, nextCopy, READINESS_COPY } from '../../testSurface/copy/readiness.js';
|
|
7
|
+
import { READINESS } from '../../testSurface/surface/readiness/readiness.model.js';
|
|
8
8
|
import { sanitizeReadinessDetail } from '../../sanitizeReadinessDetail.js';
|
|
9
9
|
export function healthDot(test, summary) {
|
|
10
10
|
const code = summary?.verdict?.code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TestsSurfaceProps } from '../../../types/surface.js';
|
|
2
|
-
import type { SurfaceProps } from '
|
|
2
|
+
import type { SurfaceProps } from '../../../testSurface/surface/contracts.js';
|
|
3
3
|
import './newTest.css';
|
|
4
4
|
export declare function NewTest({ surface, pages }: {
|
|
5
5
|
surface: SurfaceProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
3
|
+
import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
|
|
4
4
|
import { fetchAllDocs } from '../../../lib/fetchAllDocs.js';
|
|
5
5
|
import { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { useRouter } from 'next/navigation.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocId } from '../../../types/contracts.js';
|
|
2
|
-
import type { SurfaceProps } from '
|
|
2
|
+
import type { SurfaceProps } from '../../../testSurface/surface/contracts.js';
|
|
3
3
|
/** One session stays mounted across Collection, all page steps and Review. */
|
|
4
4
|
export declare function PageWizard({ id, surface }: {
|
|
5
5
|
id: DocId;
|
|
@@ -3,20 +3,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { useRouter } from 'next/navigation.js';
|
|
5
5
|
import { formatAdminURL } from 'payload/shared';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { canStartTest, readyToStart } from '../../../testSurface/readinessRead.js';
|
|
7
|
+
import { useTestDocument } from '../../../testSurface/surface/useTestDocument.js';
|
|
8
|
+
import { CopyRoute } from '../../../testSurface/surface/pagePicker/CopyRoute.js';
|
|
9
|
+
import { PageCombobox } from '../../../testSurface/surface/pagePicker/PageCombobox.js';
|
|
10
|
+
import { testPageCollection, controlFirst } from '../../../testSurface/surface/pagePicker/pagePicker.model.js';
|
|
10
11
|
import { NEW_TEST_COPY as C } from '../../copy/newTest.js';
|
|
11
|
-
import { READINESS_COPY } from '
|
|
12
|
-
import { TEST_PAGE } from '
|
|
13
|
-
import { SURFACE_COPY } from '
|
|
14
|
-
import { pageStepCopy } from '
|
|
15
|
-
import { READINESS, nextStep, pageReadinessContext, readinessArm } from '
|
|
16
|
-
import { FieldErrors } from '
|
|
17
|
-
import { SaveStatus } from '
|
|
18
|
-
import { createApi } from '
|
|
19
|
-
import { useTransition } from '
|
|
12
|
+
import { READINESS_COPY } from '../../../testSurface/copy/readiness.js';
|
|
13
|
+
import { TEST_PAGE } from '../../../testSurface/copy/testPage.js';
|
|
14
|
+
import { SURFACE_COPY } from '../../../testSurface/copy/surface.js';
|
|
15
|
+
import { pageStepCopy } from '../../../testSurface/copy/pages.js';
|
|
16
|
+
import { READINESS, nextStep, pageReadinessContext, readinessArm } from '../../../testSurface/surface/readiness/readiness.model.js';
|
|
17
|
+
import { FieldErrors } from '../../../testSurface/surface/test/fields.js';
|
|
18
|
+
import { SaveStatus } from '../../../testSurface/surface/readiness/SaveStatus.js';
|
|
19
|
+
import { createApi } from '../../../testSurface/api.js';
|
|
20
|
+
import { useTransition } from '../../../testSurface/surface/readiness/useTransition.js';
|
|
20
21
|
/** One session stays mounted across Collection, all page steps and Review. */ export function PageWizard({ id, surface }) {
|
|
21
22
|
const router = useRouter();
|
|
22
23
|
const collections = surface.pageCollections ?? [];
|
|
@@ -29,7 +30,7 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
29
30
|
adminRoute: surface.adminRoute,
|
|
30
31
|
path: `/experiments/${encodeURIComponent(String(id))}`
|
|
31
32
|
});
|
|
32
|
-
const transition = useTransition(test, ()=>router.push(testUrl));
|
|
33
|
+
const transition = useTransition(test, ()=>router.push(testUrl), surface);
|
|
33
34
|
useEffect(()=>{
|
|
34
35
|
if (step === 'review') void test.refreshPreflight();
|
|
35
36
|
}, [
|
|
@@ -45,13 +46,13 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
45
46
|
children: [
|
|
46
47
|
/*#__PURE__*/ _jsx("p", {
|
|
47
48
|
role: "alert",
|
|
48
|
-
children: test.
|
|
49
|
+
children: test.preflightRead?.message ?? TEST_PAGE.error
|
|
49
50
|
}),
|
|
50
|
-
/*#__PURE__*/ _jsx("button", {
|
|
51
|
+
test.preflightRead?.retry ? /*#__PURE__*/ _jsx("button", {
|
|
51
52
|
type: "button",
|
|
52
53
|
onClick: ()=>void test.reload(),
|
|
53
54
|
children: TEST_PAGE.retry
|
|
54
|
-
}),
|
|
55
|
+
}) : null,
|
|
55
56
|
/*#__PURE__*/ _jsx("button", {
|
|
56
57
|
type: "button",
|
|
57
58
|
onClick: leave,
|
|
@@ -72,7 +73,7 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
72
73
|
const arm = arms.find((item)=>item.key === step);
|
|
73
74
|
const ctx = pageReadinessContext(doc, test.preflight, surface);
|
|
74
75
|
const next = nextStep(test.preflight, ctx);
|
|
75
|
-
const ready =
|
|
76
|
+
const ready = readyToStart(test);
|
|
76
77
|
const busy = test.hasUnsaved || test.saving === 'saving' || transition.busy;
|
|
77
78
|
const jump = (section, key)=>{
|
|
78
79
|
if (section === 'versions') setStep(key ?? arms.find((item)=>!item.pageTarget)?.key ?? 'control');
|
|
@@ -91,7 +92,8 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
91
92
|
children: step === 'collection' ? C.collection : step === 'review' ? C.review : arm?.kind === 'control' ? C.original : pageStepCopy(arm?.label ?? '')
|
|
92
93
|
}),
|
|
93
94
|
/*#__PURE__*/ _jsx(SaveStatus, {
|
|
94
|
-
test: test
|
|
95
|
+
test: test,
|
|
96
|
+
messageInBlockerList: step === 'review' && !!test.preflight && !test.preflightError
|
|
95
97
|
}),
|
|
96
98
|
test.errors._section ? /*#__PURE__*/ _jsx("p", {
|
|
97
99
|
role: "alert",
|
|
@@ -122,10 +124,6 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
122
124
|
]
|
|
123
125
|
}) : step === 'review' ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
124
126
|
children: [
|
|
125
|
-
test.preflightError ? /*#__PURE__*/ _jsx("p", {
|
|
126
|
-
role: "alert",
|
|
127
|
-
children: test.preflightError
|
|
128
|
-
}) : null,
|
|
129
127
|
/*#__PURE__*/ _jsx("ul", {
|
|
130
128
|
children: test.preflight?.checks.map((check, index)=>{
|
|
131
129
|
if (!Object.hasOwn(READINESS, check.code)) return check.ok ? null : /*#__PURE__*/ _jsx("li", {
|
|
@@ -151,9 +149,9 @@ import { useTransition } from '../readiness/useTransition.js';
|
|
|
151
149
|
}) : null,
|
|
152
150
|
/*#__PURE__*/ _jsx("button", {
|
|
153
151
|
type: "button",
|
|
154
|
-
disabled: busy || test.preflightPending || !test.preflight,
|
|
152
|
+
disabled: busy || test.preflightPending || !test.preflight || ready && (!canStartTest(test) || transition.checking),
|
|
155
153
|
onClick: ()=>{
|
|
156
|
-
if (ready) void transition.run(()=>createApi(surface.apiRoute).start(id));
|
|
154
|
+
if (ready) void transition.run('start', ()=>createApi(surface.apiRoute).start(id));
|
|
157
155
|
else if (next) jump(next.section, next.arm);
|
|
158
156
|
},
|
|
159
157
|
children: ready ? C.start : C.finishSetup
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ResultsResponse } from '../../../types/endpoints.js';
|
|
3
|
-
import type { SectionProps } from '
|
|
4
|
-
import type { ResultsPageParts } from '
|
|
3
|
+
import type { SectionProps } from '../../../testSurface/surface/contracts.js';
|
|
4
|
+
import type { ResultsPageParts } from '../../../testSurface/surface/results/ResultsBody.js';
|
|
5
5
|
export declare function ResultsHeader({ test, surface, resultsVersion, children, actions, released }: SectionProps & ResultsPageParts): import("react").JSX.Element;
|
|
6
6
|
export declare function ReaderResultsShell({ surface, children, data }: {
|
|
7
7
|
surface: SectionProps['surface'];
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { canStartTest, readyToStart } from '../../../testSurface/readinessRead.js';
|
|
4
|
+
import { BlockerList } from '../../../testSurface/surface/readiness/BlockerList.js';
|
|
5
|
+
import { ReadinessReadStatus } from '../../../testSurface/surface/readiness/SaveStatus.js';
|
|
6
|
+
import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
|
|
4
7
|
import { useEffect, useState } from 'react';
|
|
5
8
|
import { formatAdminURL } from 'payload/shared';
|
|
6
9
|
import { SurfaceShell } from '../SurfaceShell.js';
|
|
7
10
|
import { Button } from '../../../ui/Button.js';
|
|
8
11
|
import { Banner, StatusChip } from '../../../ui/Feedback.js';
|
|
9
|
-
import { createApi } from '
|
|
10
|
-
import { availableActions, actionGroupLabel } from '
|
|
11
|
-
import { AllocateAction, ConfirmAction } from '
|
|
12
|
-
import { READINESS, daysRemaining, displayDate,
|
|
13
|
-
import { READINESS_COPY as R, runningCopy, stoppedCopy, decidedCopy } from '
|
|
14
|
-
import { RESULTS_COPY as C } from '
|
|
15
|
-
import { TEST_PAGE } from '
|
|
12
|
+
import { createApi } from '../../../testSurface/api.js';
|
|
13
|
+
import { availableActions, actionGroupLabel } from '../../../testSurface/actions/actions.model.js';
|
|
14
|
+
import { AllocateAction, ConfirmAction } from '../../../testSurface/surface/readiness/ActionDialogs.js';
|
|
15
|
+
import { READINESS, daysRemaining, displayDate, blockingSteps, pageReadinessContext } from '../../../testSurface/surface/readiness/readiness.model.js';
|
|
16
|
+
import { READINESS_COPY as R, runningCopy, stoppedCopy, decidedCopy } from '../../../testSurface/copy/readiness.js';
|
|
17
|
+
import { RESULTS_COPY as C } from '../../../testSurface/copy/results.js';
|
|
18
|
+
import { TEST_PAGE } from '../../../testSurface/copy/testPage.js';
|
|
16
19
|
export function ResultsHeader({ test, surface, resultsVersion, children, actions, released }) {
|
|
17
20
|
const doc = test.doc;
|
|
18
21
|
const [selected, setSelected] = useState(null);
|
|
@@ -55,9 +58,10 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
|
|
|
55
58
|
'allocate',
|
|
56
59
|
'stop'
|
|
57
60
|
].indexOf(b.id) : 0);
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
+
const setup = doc.status === 'draft' || doc.status === 'stopped';
|
|
62
|
+
const blockers = blockingSteps(test.preflight, pageReadinessContext(doc, test.preflight, surface));
|
|
63
|
+
const ready = readyToStart(test);
|
|
64
|
+
const startReason = test.preflightError ?? blockers[0]?.sentence ?? (!ready ? R.checking : undefined);
|
|
61
65
|
const action = available.find((item)=>item.id === selected);
|
|
62
66
|
const sentence = doc.status === 'running' ? runningCopy(displayDate(doc.startedAt), people, daysRemaining(doc, Date.now())) : doc.status === 'stopped' ? stoppedCopy(displayDate(doc.stoppedAt)) : doc.status === 'decided' ? decidedCopy(displayDate(doc.decidedAt), winner) : doc.status === 'archived' ? R.archived : null;
|
|
63
67
|
const testURL = formatAdminURL({
|
|
@@ -114,7 +118,7 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
|
|
|
114
118
|
}),
|
|
115
119
|
available.map((item)=>/*#__PURE__*/ _jsx(Button, {
|
|
116
120
|
variant: item.tone === 'danger' ? 'danger' : 'secondary',
|
|
117
|
-
disabled: item.id === 'start' &&
|
|
121
|
+
disabled: item.id === 'start' && !canStartTest(test) || !!selected || test.hasUnsaved || test.saving === 'saving' || item.id === 'allocate' && doc.allocation >= 100,
|
|
118
122
|
title: item.id === 'start' ? startReason : item.id === 'allocate' && doc.allocation >= 100 ? R.everyone : undefined,
|
|
119
123
|
onClick: ()=>setSelected(item.id),
|
|
120
124
|
children: item.id === 'allocate' ? R.allocate : item.label
|
|
@@ -127,9 +131,12 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
|
|
|
127
131
|
tone: "error",
|
|
128
132
|
children: test.errors._section
|
|
129
133
|
}) : null,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
/*#__PURE__*/ _jsx(ReadinessReadStatus, {
|
|
135
|
+
test: test,
|
|
136
|
+
messageInBlockerList: setup && !!test.preflight && !test.preflightError
|
|
137
|
+
}),
|
|
138
|
+
setup ? /*#__PURE__*/ _jsx(BlockerList, {
|
|
139
|
+
steps: blockers
|
|
133
140
|
}) : null,
|
|
134
141
|
children,
|
|
135
142
|
action?.id === 'allocate' ? /*#__PURE__*/ _jsx(AllocateAction, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DocId } from '../../../types/contracts.js';
|
|
2
|
-
import type { SurfaceProps } from '
|
|
3
|
-
import './testPage.css';
|
|
2
|
+
import type { SurfaceProps } from '../../../testSurface/surface/contracts.js';
|
|
4
3
|
export declare function TestPage({ id, surface, onTitleChange }: {
|
|
5
4
|
id: DocId;
|
|
6
5
|
surface: SurfaceProps;
|