@delmaredigital/payload-experiments 0.4.0-rc.7 → 0.4.0
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 +9 -15
- package/dist/admin/MetricSourceSelect.js +10 -3
- package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +75 -29
- package/dist/admin/blocks/model.js +7 -6
- package/dist/admin/copy/blocks.d.ts +14 -11
- package/dist/admin/copy/blocks.js +33 -22
- package/dist/admin/copy/goals.d.ts +15 -8
- package/dist/admin/copy/goals.js +18 -8
- package/dist/admin/copy/newTest.d.ts +10 -7
- package/dist/admin/copy/newTest.js +14 -7
- package/dist/admin/copy/status.d.ts +1 -1
- package/dist/admin/copy/status.js +2 -1
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/placementStatus.model.js +5 -3
- package/dist/admin/status.model.d.ts +1 -0
- package/dist/admin/status.model.js +2 -1
- package/dist/admin/surface/ResultsRoute.js +12 -10
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +28 -3
- package/dist/admin/surface/TestRowMenu.d.ts +13 -0
- package/dist/admin/surface/TestRowMenu.js +163 -0
- package/dist/admin/surface/TestsHome.d.ts +4 -3
- package/dist/admin/surface/TestsHome.js +224 -52
- package/dist/admin/surface/TestsSurface.js +2 -1
- package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
- package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
- package/dist/admin/surface/goals/GoalForm.js +280 -198
- package/dist/admin/surface/goals/GoalsList.js +102 -33
- package/dist/admin/surface/goals/data.d.ts +2 -0
- package/dist/admin/surface/goals/data.js +9 -0
- package/dist/admin/surface/goals/goals.css +3 -2
- package/dist/admin/surface/goals/goals.model.d.ts +2 -2
- package/dist/admin/surface/goals/goals.model.js +7 -12
- package/dist/admin/surface/home.model.d.ts +15 -8
- package/dist/admin/surface/home.model.js +22 -18
- package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
- package/dist/admin/surface/newTest/NewTest.js +156 -96
- package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
- package/dist/admin/surface/newTest/PageWizard.js +99 -68
- package/dist/admin/surface/newTest/newTest.css +28 -11
- package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +98 -66
- package/dist/admin/surface/surface.css +29 -0
- package/dist/admin/surface/test/TestPage.js +46 -38
- package/dist/admin/surface/useXpStepNav.d.ts +11 -0
- package/dist/admin/surface/useXpStepNav.js +14 -0
- package/dist/admin/views/TestsSurfaceClient.js +27 -3
- package/dist/admin/views/buildSurfaceProps.js +18 -66
- package/dist/arms/copy.d.ts +13 -3
- package/dist/arms/copy.js +5 -4
- package/dist/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +2 -2
- package/dist/collections/experiments/armInvariants.js +8 -5
- package/dist/collections/experiments/config.js +8 -3
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metrics.js +12 -5
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +8 -6
- 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/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/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +2 -0
- package/dist/endpoints/deleteImpact.js +2 -1
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +414 -0
- package/dist/endpoints/editorSurface.js +1 -1
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +22 -8
- package/dist/endpoints/pages.js +245 -66
- package/dist/endpoints/placementStatus.js +8 -4
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +9 -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 +4 -0
- package/dist/errors.js +6 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +2 -2
- package/dist/goals/picker/copy.js +1 -1
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.js +4 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/labels/arms.d.ts +3 -0
- package/dist/labels/arms.js +8 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/manifest/compile.js +8 -5
- package/dist/onInit.js +14 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +56 -2
- 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/editor/ConfigureTestDrawer.d.ts +7 -7
- package/dist/puck/editor/ConfigureTestDrawer.js +40 -29
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +376 -139
- package/dist/puck/editor/LeftoverVersions.js +17 -32
- package/dist/puck/editor/QuickTestActions.d.ts +6 -3
- package/dist/puck/editor/QuickTestActions.js +55 -33
- package/dist/puck/editor/ResultsReadout.d.ts +4 -1
- package/dist/puck/editor/ResultsReadout.js +28 -15
- package/dist/puck/editor/VersionBuilder.d.ts +17 -4
- package/dist/puck/editor/VersionBuilder.js +175 -112
- package/dist/puck/editor/armWrites.js +2 -2
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/copy.d.ts +14 -7
- package/dist/puck/editor/copy.js +26 -13
- package/dist/puck/editor/editor.chrome.css +10 -8
- package/dist/puck/editor/editor.css +15 -9
- package/dist/puck/editor/editor.model.d.ts +1 -0
- package/dist/puck/editor/placementsCache.d.ts +4 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/nestedTestCopy.js +2 -2
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +1 -1
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- 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.d.ts +4 -4
- package/dist/results/verdict.js +15 -11
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +11 -2
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +2 -5
- package/dist/server/runResults.js +54 -15
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +10 -4
- package/dist/testSurface/actions/DecideDialog.js +93 -63
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +10 -2
- package/dist/testSurface/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +75 -22
- package/dist/testSurface/actions/decide.model.d.ts +1 -0
- package/dist/testSurface/actions/decide.model.js +1 -0
- package/dist/testSurface/allocation.model.js +6 -3
- package/dist/testSurface/api.d.ts +9 -6
- package/dist/testSurface/api.js +43 -23
- package/dist/testSurface/copy/actions.d.ts +37 -14
- package/dist/testSurface/copy/actions.js +40 -17
- package/dist/testSurface/copy/advanced.d.ts +10 -0
- package/dist/testSurface/copy/advanced.js +10 -0
- package/dist/testSurface/copy/arms.d.ts +1 -1
- package/dist/testSurface/copy/arms.js +1 -1
- package/dist/testSurface/copy/audience.d.ts +4 -3
- package/dist/testSurface/copy/audience.js +5 -4
- package/dist/testSurface/copy/common.d.ts +8 -6
- package/dist/testSurface/copy/common.js +8 -6
- package/dist/testSurface/copy/languages.d.ts +1 -0
- package/dist/testSurface/copy/languages.js +1 -0
- package/dist/testSurface/copy/metrics.d.ts +7 -0
- package/dist/testSurface/copy/metrics.js +9 -0
- package/dist/testSurface/copy/pages.d.ts +67 -7
- package/dist/testSurface/copy/pages.js +74 -7
- package/dist/testSurface/copy/readiness.d.ts +20 -7
- package/dist/testSurface/copy/readiness.js +36 -10
- package/dist/testSurface/copy/recommendation.d.ts +1 -22
- package/dist/testSurface/copy/recommendation.js +2 -22
- package/dist/testSurface/copy/results.d.ts +21 -12
- package/dist/testSurface/copy/results.js +24 -13
- package/dist/testSurface/copy/review.d.ts +13 -10
- package/dist/testSurface/copy/review.js +14 -10
- package/dist/testSurface/copy/setting.d.ts +1 -2
- package/dist/testSurface/copy/setting.js +1 -2
- package/dist/testSurface/copy/surface.d.ts +11 -2
- package/dist/testSurface/copy/surface.js +14 -11
- package/dist/testSurface/copy/testPage.d.ts +36 -12
- package/dist/testSurface/copy/testPage.js +53 -16
- package/dist/testSurface/format/date.d.ts +5 -2
- package/dist/testSurface/format/date.js +24 -8
- package/dist/testSurface/format/roundProgress.d.ts +6 -0
- package/dist/testSurface/format/roundProgress.js +15 -0
- package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
- package/dist/testSurface/format/useDateFormatter.js +8 -0
- package/dist/testSurface/labels.d.ts +1 -2
- package/dist/testSurface/labels.js +2 -3
- package/dist/testSurface/lockedNotice.model.d.ts +2 -0
- package/dist/testSurface/lockedNotice.model.js +31 -0
- package/dist/testSurface/readPreflight.d.ts +4 -0
- package/dist/testSurface/readPreflight.js +6 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/CiChart.js +2 -1
- package/dist/testSurface/results/DataTable.d.ts +1 -1
- package/dist/testSurface/results/DataTable.js +4 -3
- package/dist/testSurface/results/VerdictHero.d.ts +3 -2
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/legacy.d.ts +0 -5
- package/dist/testSurface/results/legacy.js +0 -14
- package/dist/testSurface/results/results.css +2 -2
- package/dist/testSurface/results/results.model.d.ts +9 -4
- package/dist/testSurface/results/results.model.js +31 -23
- package/dist/testSurface/results/snapshot.d.ts +2 -0
- package/dist/testSurface/results/snapshot.js +3 -0
- package/dist/testSurface/surface/contracts.d.ts +13 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +3 -3
- package/dist/testSurface/surface/editorPlacement.js +2 -2
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +3 -3
- package/dist/testSurface/surface/pageBlock/parts.js +25 -12
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +300 -197
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
- package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
- package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +9 -5
- package/dist/testSurface/surface/readiness/ActionDialogs.js +241 -230
- package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
- package/dist/testSurface/surface/readiness/Banner.js +113 -141
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +8 -4
- package/dist/testSurface/surface/readiness/SaveStatus.js +23 -22
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +20 -6
- package/dist/testSurface/surface/readiness/readiness.model.js +168 -21
- package/dist/testSurface/surface/readiness/useTransition.d.ts +6 -4
- package/dist/testSurface/surface/readiness/useTransition.js +57 -14
- package/dist/testSurface/surface/results/ReleasePages.d.ts +6 -3
- package/dist/testSurface/surface/results/ReleasePages.js +42 -41
- package/dist/testSurface/surface/results/ResultsBody.d.ts +11 -4
- package/dist/testSurface/surface/results/ResultsBody.js +221 -118
- package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
- package/dist/testSurface/surface/results/recommendation.model.js +15 -59
- package/dist/testSurface/surface/results/useResults.d.ts +13 -8
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +89 -46
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +11 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +10 -2
- package/dist/testSurface/surface/test/DeleteTest.js +173 -74
- package/dist/testSurface/surface/test/GoalSection.js +18 -14
- package/dist/testSurface/surface/test/LengthSection.js +24 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +11 -8
- package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
- package/dist/testSurface/surface/test/Section.js +8 -0
- package/dist/testSurface/surface/test/TargetingSection.js +82 -12
- package/dist/testSurface/surface/test/TestSurface.js +73 -37
- package/dist/testSurface/surface/test/VersionsSection.js +141 -91
- package/dist/testSurface/surface/test/fields.d.ts +32 -6
- package/dist/testSurface/surface/test/fields.js +166 -52
- package/dist/testSurface/surface/test/pageParts.js +27 -12
- package/dist/testSurface/surface/test/testPage.css +9 -2
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +21 -5
- package/dist/testSurface/surface/useTestDocument.js +472 -167
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +1 -0
- package/dist/testSurface/surfaceUrls.js +4 -0
- package/dist/testSurface/useApi.d.ts +8 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- package/dist/transitions/addMetric.d.ts +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 +1 -0
- package/dist/transitions/checkStart.js +17 -6
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +12 -8
- package/dist/transitions/nestedPlacementNames.d.ts +2 -2
- package/dist/transitions/nestedPlacementNames.js +4 -5
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.d.ts +1 -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 +8 -7
- package/dist/transitions/placements.d.ts +2 -0
- package/dist/transitions/placements.js +5 -5
- package/dist/transitions/preflightData.d.ts +3 -2
- package/dist/transitions/preflightData.js +77 -43
- 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 +7 -9
- package/dist/transitions/start.js +75 -39
- 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/armKey.d.ts +2 -0
- package/dist/types/armKey.js +1 -0
- package/dist/types/contracts.d.ts +17 -4
- package/dist/types/endpoints.d.ts +89 -17
- package/dist/types/endpoints.js +1 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +7 -9
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +21 -2
- package/dist/ui/Dialog.js +101 -4
- package/dist/ui/Inputs.js +0 -1
- package/dist/ui/ui.css +5 -1
- package/package.json +2 -2
|
@@ -3,22 +3,33 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
|
|
4
4
|
import { sourceFor } from '../../../testSurface/metricSource.model.js';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
|
+
import { useRouter } from 'next/navigation.js';
|
|
6
7
|
import { formatAdminURL } from 'payload/shared';
|
|
7
8
|
import { Banner, EmptyState } from '../../../ui/Feedback.js';
|
|
8
9
|
import { Button } from '../../../ui/Button.js';
|
|
9
|
-
import { SearchInput } from '../../../ui/
|
|
10
|
+
import { SearchInput } from '../../../ui/SearchInput.js';
|
|
10
11
|
import { SurfaceShell } from '../SurfaceShell.js';
|
|
12
|
+
import { useXpStepNav } from '../useXpStepNav.js';
|
|
13
|
+
import { RowMenu } from '../TestRowMenu.js';
|
|
11
14
|
import { SURFACE_COPY } from '../../../testSurface/copy/surface.js';
|
|
12
15
|
import { GOALS_COPY as C, goalsNoMatches, goalUsedBy } from '../../copy/goals.js';
|
|
13
16
|
import { METRIC_KIND_LABELS } from '../../../testSurface/copy/metrics.js';
|
|
14
17
|
import { goalUsage } from './goals.model.js';
|
|
15
18
|
import { goalPages } from './data.js';
|
|
19
|
+
import { DeleteGoalDialog } from './DeleteGoalDialog.js';
|
|
16
20
|
import './goals.css';
|
|
17
21
|
export function GoalsList({ surface, returnToTest }) {
|
|
22
|
+
useXpStepNav([
|
|
23
|
+
{
|
|
24
|
+
label: C.title
|
|
25
|
+
}
|
|
26
|
+
]);
|
|
27
|
+
const router = useRouter();
|
|
18
28
|
const [data, setData] = useState();
|
|
19
29
|
const [error, setError] = useState('');
|
|
20
30
|
const [attempt, setAttempt] = useState(0);
|
|
21
31
|
const [search, setSearch] = useState('');
|
|
32
|
+
const [deleting, setDeleting] = useState();
|
|
22
33
|
const returnQuery = returnToTest ? `?${new URLSearchParams({
|
|
23
34
|
return: returnToTest
|
|
24
35
|
})}` : '';
|
|
@@ -48,14 +59,14 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
48
59
|
attempt
|
|
49
60
|
]);
|
|
50
61
|
const usage = goalUsage(data?.tests ?? []);
|
|
51
|
-
const
|
|
52
|
-
const goals = data?.goals.filter((goal)
|
|
62
|
+
const query = search.trim().toLocaleLowerCase('en-US');
|
|
63
|
+
const goals = data?.goals.filter((goal)=>goal.name.toLocaleLowerCase('en-US').includes(query)) ?? [];
|
|
53
64
|
const newGoal = surface.canManage ? /*#__PURE__*/ _jsx(Button, {
|
|
54
65
|
variant: "primary",
|
|
55
66
|
href: url(`/experiments/goals/new${returnQuery}`),
|
|
56
67
|
children: C.newGoal
|
|
57
68
|
}) : null;
|
|
58
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/ _jsxs(SurfaceShell, {
|
|
59
70
|
adminRoute: surface.adminRoute,
|
|
60
71
|
title: C.title,
|
|
61
72
|
crumbs: [
|
|
@@ -69,6 +80,35 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
69
80
|
],
|
|
70
81
|
actions: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
71
82
|
children: [
|
|
83
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
84
|
+
className: "xp-tests-search",
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsxs("svg", {
|
|
87
|
+
viewBox: "0 0 16 16",
|
|
88
|
+
fill: "none",
|
|
89
|
+
stroke: "currentColor",
|
|
90
|
+
strokeWidth: "1.5",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
94
|
+
cx: "7",
|
|
95
|
+
cy: "7",
|
|
96
|
+
r: "4.5"
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ _jsx("path", {
|
|
99
|
+
d: "m10.5 10.5 3.5 3.5"
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ _jsx(SearchInput, {
|
|
104
|
+
id: "xp-goals-search",
|
|
105
|
+
label: C.search,
|
|
106
|
+
placeholder: C.search,
|
|
107
|
+
value: search,
|
|
108
|
+
onChange: (event)=>setSearch(event.target.value)
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}),
|
|
72
112
|
returnToTest ? /*#__PURE__*/ _jsx(Button, {
|
|
73
113
|
variant: "quiet",
|
|
74
114
|
href: url(`/experiments/${encodeURIComponent(returnToTest)}`),
|
|
@@ -77,17 +117,10 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
77
117
|
newGoal
|
|
78
118
|
]
|
|
79
119
|
}),
|
|
80
|
-
children:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
id: "xp-goals-search",
|
|
85
|
-
label: C.search,
|
|
86
|
-
placeholder: C.search,
|
|
87
|
-
value: search,
|
|
88
|
-
onChange: (event)=>setSearch(event.target.value)
|
|
89
|
-
}) : null,
|
|
90
|
-
error ? /*#__PURE__*/ _jsx(Banner, {
|
|
120
|
+
children: [
|
|
121
|
+
/*#__PURE__*/ _jsx("div", {
|
|
122
|
+
className: "xp-goals",
|
|
123
|
+
children: error ? /*#__PURE__*/ _jsx(Banner, {
|
|
91
124
|
tone: "error",
|
|
92
125
|
action: /*#__PURE__*/ _jsx(Button, {
|
|
93
126
|
size: "sm",
|
|
@@ -101,13 +134,19 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
101
134
|
}) : !data.goals.length ? /*#__PURE__*/ _jsx(EmptyState, {
|
|
102
135
|
action: newGoal,
|
|
103
136
|
children: C.empty
|
|
104
|
-
}) : !goals.length ? /*#__PURE__*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
137
|
+
}) : !goals.length ? /*#__PURE__*/ _jsxs("div", {
|
|
138
|
+
className: "xp-tests-no-matches",
|
|
139
|
+
children: [
|
|
140
|
+
/*#__PURE__*/ _jsx("p", {
|
|
141
|
+
children: goalsNoMatches(search)
|
|
142
|
+
}),
|
|
143
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
144
|
+
variant: "quiet",
|
|
145
|
+
size: "sm",
|
|
146
|
+
onClick: ()=>setSearch(''),
|
|
147
|
+
children: C.clearSearch
|
|
148
|
+
})
|
|
149
|
+
]
|
|
111
150
|
}) : /*#__PURE__*/ _jsx("div", {
|
|
112
151
|
className: "xp-tests-list",
|
|
113
152
|
children: goals.map((goal)=>{
|
|
@@ -115,6 +154,25 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
115
154
|
const kind = sourceFor(goal.source, surface.metricSources)?.kind;
|
|
116
155
|
const label = kind && Object.hasOwn(METRIC_KIND_LABELS, kind) ? METRIC_KIND_LABELS[kind] : undefined;
|
|
117
156
|
const href = url(`/experiments/goals/${encodeURIComponent(String(goal.id))}${returnQuery}`);
|
|
157
|
+
const returnHref = returnToTest ? url(`/experiments/${encodeURIComponent(returnToTest)}?${new URLSearchParams({
|
|
158
|
+
goal: String(goal.id)
|
|
159
|
+
})}`) : undefined;
|
|
160
|
+
const actions = [
|
|
161
|
+
...returnHref ? [
|
|
162
|
+
{
|
|
163
|
+
id: 'use',
|
|
164
|
+
label: C.useGoal,
|
|
165
|
+
tone: 'primary'
|
|
166
|
+
}
|
|
167
|
+
] : [],
|
|
168
|
+
...surface.canManage && !count ? [
|
|
169
|
+
{
|
|
170
|
+
id: 'delete',
|
|
171
|
+
label: C.remove,
|
|
172
|
+
tone: 'danger'
|
|
173
|
+
}
|
|
174
|
+
] : []
|
|
175
|
+
];
|
|
118
176
|
return /*#__PURE__*/ _jsxs("article", {
|
|
119
177
|
className: "xp-tests-row",
|
|
120
178
|
children: [
|
|
@@ -151,20 +209,31 @@ export function GoalsList({ surface, returnToTest }) {
|
|
|
151
209
|
})
|
|
152
210
|
]
|
|
153
211
|
}),
|
|
154
|
-
/*#__PURE__*/ _jsx(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
})
|
|
212
|
+
actions.length ? /*#__PURE__*/ _jsx(RowMenu, {
|
|
213
|
+
label: `Actions for ${goal.name}`,
|
|
214
|
+
actions: actions,
|
|
215
|
+
onSelect: (action)=>{
|
|
216
|
+
if (action.id === 'use' && returnHref) router.push(returnHref);
|
|
217
|
+
else if (action.id === 'delete') setDeleting(goal);
|
|
218
|
+
}
|
|
219
|
+
}) : null
|
|
163
220
|
]
|
|
164
221
|
}, `${typeof goal.id}:${goal.id}`);
|
|
165
222
|
})
|
|
166
223
|
})
|
|
167
|
-
|
|
168
|
-
|
|
224
|
+
}),
|
|
225
|
+
deleting ? /*#__PURE__*/ _jsx(DeleteGoalDialog, {
|
|
226
|
+
goal: deleting,
|
|
227
|
+
apiRoute: surface.apiRoute,
|
|
228
|
+
onClose: ()=>setDeleting(undefined),
|
|
229
|
+
onDeleted: ()=>{
|
|
230
|
+
setData((current)=>current && {
|
|
231
|
+
...current,
|
|
232
|
+
goals: current.goals.filter((goal)=>goal.id !== deleting.id)
|
|
233
|
+
});
|
|
234
|
+
setDeleting(undefined);
|
|
235
|
+
}
|
|
236
|
+
}) : null
|
|
237
|
+
]
|
|
169
238
|
});
|
|
170
239
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DocId } from '../../../types/contracts.js';
|
|
1
2
|
export declare class GoalResponseError extends Error {
|
|
2
3
|
readonly fields: Record<string, string>;
|
|
3
4
|
constructor(message: string, fields: Record<string, string>);
|
|
@@ -7,3 +8,4 @@ export declare function goalResponse(response: Response, fallback: string, optio
|
|
|
7
8
|
notFound?: string;
|
|
8
9
|
}): Promise<unknown>;
|
|
9
10
|
export declare function goalPages<T>(base: string, collection: 'xp-metrics' | 'xp-experiments', signal: AbortSignal): Promise<T[]>;
|
|
11
|
+
export declare function deleteGoal(apiRoute: string, id: DocId): Promise<void>;
|
|
@@ -33,3 +33,12 @@ export async function goalPages(base, collection, signal) {
|
|
|
33
33
|
if (!result.ok) goalRefusal(result.body, result.status, C.loadError);
|
|
34
34
|
return result.docs;
|
|
35
35
|
}
|
|
36
|
+
export async function deleteGoal(apiRoute, id) {
|
|
37
|
+
const response = await fetch(`${apiRoute.replace(/\/$/, '')}/xp-metrics/${encodeURIComponent(id)}`, {
|
|
38
|
+
method: 'DELETE',
|
|
39
|
+
credentials: 'include'
|
|
40
|
+
});
|
|
41
|
+
await goalResponse(response, C.deleteError, {
|
|
42
|
+
notFound: C.notFound
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* Compact rows reuse surface.css's xp-tests-list / xp-tests-row classes. */
|
|
2
2
|
.xp-goals { display: grid; gap: var(--xp-space-4); }
|
|
3
|
-
.xp-goals > .xp-ui-field { max-width: 20rem; }
|
|
4
3
|
.xp-goal-form { max-width: 48rem; display: grid; gap: var(--xp-space-4); }
|
|
5
4
|
.xp-goal-card { display: grid; gap: var(--xp-space-4); }
|
|
6
5
|
.xp-goal-card > h2 { margin: 0; font: var(--xp-text-title); }
|
|
@@ -10,10 +9,12 @@
|
|
|
10
9
|
.xp-goal-advanced > summary { padding: var(--xp-space-4); cursor: pointer; font: var(--xp-text-body); }
|
|
11
10
|
.xp-goal-advanced > summary:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
|
|
12
11
|
.xp-goal-advanced-fields { display: grid; gap: var(--xp-space-4); padding: 0 var(--xp-space-4) var(--xp-space-4); }
|
|
12
|
+
.xp-goal-advanced-fields h3 { margin: 0; font: var(--xp-text-title); }
|
|
13
|
+
.xp-goal-save { position: sticky; bottom: 0; background: var(--xp-surface); padding: var(--xp-space-3) 0; }
|
|
13
14
|
|
|
14
15
|
.xp-goal-usage { display: grid; gap: var(--xp-space-3); }
|
|
15
16
|
.xp-goal-usage > h2, .xp-goal-usage > ul { margin: 0; }
|
|
16
17
|
.xp-goal-usage > h2 { font: var(--xp-text-title); }
|
|
17
18
|
.xp-goal-usage > ul { display: grid; gap: var(--xp-space-3); padding-inline-start: var(--xp-space-5); }
|
|
18
|
-
.xp-goal-usage
|
|
19
|
+
.xp-goal-usage-roles { margin-inline: var(--xp-space-2); color: var(--xp-text-2); font: var(--xp-text-small); }
|
|
19
20
|
.xp-goal-usage > .xp-ui-button { justify-self: start; }
|
|
@@ -28,12 +28,12 @@ export interface GoalUsageTest {
|
|
|
28
28
|
}
|
|
29
29
|
/** Count each experiment once per goal, retaining the API's id types. */
|
|
30
30
|
export declare function goalUsage(tests: readonly GoalUsageTest[]): Map<DocId, number>;
|
|
31
|
-
export { goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
31
|
+
export { clickGoalSlug as goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
32
32
|
/** One row per readable test returned by the API, retaining every role. */
|
|
33
33
|
export declare function goalUsageRows(tests: readonly GoalUsageTest[], goalId: DocId): {
|
|
34
34
|
id: DocId;
|
|
35
35
|
name: string;
|
|
36
36
|
roles: string[];
|
|
37
|
-
status?:
|
|
37
|
+
status?: Status | null;
|
|
38
38
|
}[];
|
|
39
39
|
export declare function visibleGoalUsage<T>(rows: readonly T[], expanded: boolean): readonly T[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { statusLabel } from '../../../testSurface/labels.js';
|
|
1
|
+
import { GOALS_COPY } from '../../copy/goals.js';
|
|
3
2
|
/** Count each experiment once per goal, retaining the API's id types. */ export function goalUsage(tests) {
|
|
4
3
|
const byGoal = new Map();
|
|
5
4
|
for (const test of tests){
|
|
@@ -23,13 +22,9 @@ import { statusLabel } from '../../../testSurface/labels.js';
|
|
|
23
22
|
tests.size
|
|
24
23
|
]));
|
|
25
24
|
}
|
|
26
|
-
export { goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
25
|
+
export { clickGoalSlug as goalSlug } from '../../../goals/picker/clickGoalPicker.model.js';
|
|
27
26
|
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
|
-
};
|
|
27
|
+
const usageLabels = GOALS_COPY.roles;
|
|
33
28
|
/** One row per readable test returned by the API, retaining every role. */ export function goalUsageRows(tests, goalId) {
|
|
34
29
|
const rows = new Map();
|
|
35
30
|
for (const test of tests){
|
|
@@ -37,11 +32,11 @@ const usageLabels = {
|
|
|
37
32
|
...referenceId(test.metrics?.primary) === goalId ? [
|
|
38
33
|
usageLabels.primary
|
|
39
34
|
] : [],
|
|
40
|
-
...test.metrics?.guardrails?.some((reference)=>referenceId(reference) === goalId) ? [
|
|
41
|
-
usageLabels.guardrails
|
|
42
|
-
] : [],
|
|
43
35
|
...test.metrics?.secondary?.some((reference)=>referenceId(reference) === goalId) ? [
|
|
44
36
|
usageLabels.secondary
|
|
37
|
+
] : [],
|
|
38
|
+
...test.metrics?.guardrails?.some((reference)=>referenceId(reference) === goalId) ? [
|
|
39
|
+
usageLabels.guardrails
|
|
45
40
|
] : []
|
|
46
41
|
];
|
|
47
42
|
if (!roles.length) continue;
|
|
@@ -55,7 +50,7 @@ const usageLabels = {
|
|
|
55
50
|
...roles
|
|
56
51
|
])
|
|
57
52
|
],
|
|
58
|
-
status: test.status
|
|
53
|
+
status: test.status
|
|
59
54
|
});
|
|
60
55
|
}
|
|
61
56
|
return [
|
|
@@ -1,34 +1,41 @@
|
|
|
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 { DateFormatter } from '../../testSurface/format/date.js';
|
|
3
4
|
import type { ReadinessContext } from '../../testSurface/surface/readiness/readiness.model.js';
|
|
5
|
+
import { type ActionDecision } from '../../testSurface/actions/actions.model.js';
|
|
4
6
|
export interface HomeTest {
|
|
5
7
|
id: DocId;
|
|
6
8
|
name: string;
|
|
7
9
|
kind: ExperimentKind;
|
|
8
10
|
status: Status;
|
|
9
11
|
unitType: UnitType;
|
|
12
|
+
startedAt?: string | null;
|
|
10
13
|
updatedAt?: string | null;
|
|
11
14
|
flagPoint?: string | null;
|
|
12
15
|
analysis?: {
|
|
13
16
|
plannedDurationDays?: number | null;
|
|
14
17
|
} | null;
|
|
15
18
|
arms?: Arm[] | null;
|
|
19
|
+
phase?: number;
|
|
20
|
+
allocation?: number;
|
|
16
21
|
decidedAt?: string | null;
|
|
17
|
-
decision?:
|
|
18
|
-
winnerArm?: string | null;
|
|
19
|
-
holdoutReleasedAt?: string | null;
|
|
20
|
-
discardedAt?: string | null;
|
|
21
|
-
pagesReleasedAt?: string | null;
|
|
22
|
-
} | null;
|
|
22
|
+
decision?: ActionDecision | null;
|
|
23
23
|
}
|
|
24
24
|
type Summary = SummaryResponse[DocId] | undefined;
|
|
25
25
|
export type Health = 'red' | 'amber' | 'green';
|
|
26
26
|
export declare function healthDot(test: HomeTest, summary: Summary): Health | undefined;
|
|
27
27
|
export declare function groupTests(tests: readonly HomeTest[], summaries: SummaryResponse, search?: string): {
|
|
28
|
-
|
|
28
|
+
key: string;
|
|
29
|
+
label: "Needs attention" | "Running" | "Stopped" | "Decided" | "Ready to start" | "Draft" | "Archived";
|
|
29
30
|
tests: HomeTest[];
|
|
30
31
|
}[];
|
|
31
|
-
export declare function homeCard(test: HomeTest, summary: Summary, adminRoute: string,
|
|
32
|
+
export declare function homeCard(test: HomeTest, summary: Summary, adminRoute: string, { formatDate, now, flagPoints, goalNames, canReadResults, }: {
|
|
33
|
+
formatDate: DateFormatter;
|
|
34
|
+
now: number;
|
|
35
|
+
flagPoints?: ReadinessContext['flagPoints'];
|
|
36
|
+
goalNames?: Readonly<Record<string, string>>;
|
|
37
|
+
canReadResults?: boolean;
|
|
38
|
+
}): {
|
|
32
39
|
kind: "Page block" | "Setting" | "Whole page";
|
|
33
40
|
pill: {
|
|
34
41
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatAdminURL } from 'payload/shared';
|
|
2
|
-
import {
|
|
2
|
+
import { roundProgress } from '../../testSurface/format/roundProgress.js';
|
|
3
3
|
import { armLabel } from '../../testSurface/labels.js';
|
|
4
4
|
import { statusPill } from '../status.model.js';
|
|
5
5
|
import { decidedLine, runningLine, SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
@@ -13,35 +13,36 @@ export function healthDot(test, summary) {
|
|
|
13
13
|
return code ? 'green' : undefined;
|
|
14
14
|
}
|
|
15
15
|
export function groupTests(tests, summaries, search = '') {
|
|
16
|
-
const groups = SURFACE_COPY.groups.map((label)=>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const groups = new Map(Object.entries(SURFACE_COPY.groups).map(([key, label])=>[
|
|
17
|
+
key,
|
|
18
|
+
{
|
|
19
|
+
key,
|
|
20
|
+
label,
|
|
21
|
+
tests: []
|
|
22
|
+
}
|
|
23
|
+
]));
|
|
20
24
|
const query = search.trim().toLocaleLowerCase('en-US');
|
|
21
25
|
for (const test of tests){
|
|
22
26
|
if (!test.name.toLocaleLowerCase('en-US').includes(query)) continue;
|
|
23
27
|
const summary = summaries[test.id];
|
|
24
28
|
const health = healthDot(test, summary);
|
|
25
|
-
const
|
|
26
|
-
groups
|
|
29
|
+
const group = test.status === 'running' && (health === 'red' || health === 'amber') ? 'attention' : test.status === 'draft' && summary?.ready === true ? 'ready' : test.status;
|
|
30
|
+
(groups.get(group) ?? groups.get('draft')).tests.push(test);
|
|
27
31
|
}
|
|
28
|
-
return
|
|
32
|
+
return [
|
|
33
|
+
...groups.values()
|
|
34
|
+
];
|
|
29
35
|
}
|
|
30
36
|
const number = (value)=>value != null && Number.isFinite(value) ? new Intl.NumberFormat('en-US', {
|
|
31
37
|
maximumFractionDigits: 0
|
|
32
38
|
}).format(value) : '—';
|
|
33
|
-
export function homeCard(test, summary, adminRoute, flagPoints, goalNames = {}) {
|
|
34
|
-
const results =
|
|
35
|
-
'running',
|
|
36
|
-
'stopped',
|
|
37
|
-
'decided',
|
|
38
|
-
'archived'
|
|
39
|
-
].includes(test.status);
|
|
39
|
+
export function homeCard(test, summary, adminRoute, { formatDate, now, flagPoints, goalNames = {}, canReadResults = true }) {
|
|
40
|
+
const results = canReadResults && test.status !== 'draft';
|
|
40
41
|
const href = formatAdminURL({
|
|
41
42
|
adminRoute,
|
|
42
43
|
path: `/experiments/${encodeURIComponent(test.id)}${results ? '/results' : ''}`
|
|
43
44
|
});
|
|
44
|
-
let line = summary?.ready === true ? SURFACE_COPY.ready : nextCopy(SURFACE_COPY.next);
|
|
45
|
+
let line = summary?.ready === true ? test.status === 'stopped' ? SURFACE_COPY.readyAgain : SURFACE_COPY.ready : nextCopy(SURFACE_COPY.next);
|
|
45
46
|
const next = summary?.next;
|
|
46
47
|
if ((test.status === 'draft' || test.status === 'stopped') && summary?.ready !== true && next && Object.hasOwn(READINESS, next.code)) {
|
|
47
48
|
// Keep unexpected text out of authored copy, including responses from older servers.
|
|
@@ -56,7 +57,10 @@ export function homeCard(test, summary, adminRoute, flagPoints, goalNames = {})
|
|
|
56
57
|
});
|
|
57
58
|
if (sentence) line = nextCopy(next.code === 'page-no-targets' ? READINESS_COPY.choosePages : sentence);
|
|
58
59
|
}
|
|
59
|
-
if (test.status === 'running')
|
|
60
|
+
if (test.status === 'running') {
|
|
61
|
+
const progress = roundProgress(test.startedAt, test.analysis?.plannedDurationDays, now, summary?.days ?? 0);
|
|
62
|
+
line = runningLine(number(progress.day), number(progress.plannedDays), number(summary?.exposures));
|
|
63
|
+
}
|
|
60
64
|
if (test.status === 'decided') {
|
|
61
65
|
const winner = test.decision?.winnerArm;
|
|
62
66
|
const winnerLabel = test.arms?.find((arm)=>arm.key === winner)?.label?.trim();
|
|
@@ -69,6 +73,6 @@ export function homeCard(test, summary, adminRoute, flagPoints, goalNames = {})
|
|
|
69
73
|
line,
|
|
70
74
|
health: healthDot(test, summary),
|
|
71
75
|
href,
|
|
72
|
-
action: results ? SURFACE_COPY.results : test.status
|
|
76
|
+
action: results ? SURFACE_COPY.results : test.status !== 'draft' || summary?.ready === true ? SURFACE_COPY.open : SURFACE_COPY.continue
|
|
73
77
|
};
|
|
74
78
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockPageCollection } from '../../../types/surface.js';
|
|
2
2
|
import type { SurfaceProps } from '../../../testSurface/surface/contracts.js';
|
|
3
3
|
import './newTest.css';
|
|
4
|
-
export declare function NewTest({ surface,
|
|
4
|
+
export declare function NewTest({ surface, blockPageCollections }: {
|
|
5
5
|
surface: SurfaceProps;
|
|
6
|
-
|
|
6
|
+
blockPageCollections?: BlockPageCollection[];
|
|
7
7
|
}): import("react").JSX.Element;
|