@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,17 +3,28 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { DeleteTest } from '../../testSurface/surface/test/DeleteTest.js';
|
|
4
4
|
import { DELETE_TEST } from '../../testSurface/copy/testPage.js';
|
|
5
5
|
import { surfaceUrls } from '../../testSurface/surfaceUrls.js';
|
|
6
|
-
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { formatAdminURL } from 'payload/shared';
|
|
8
8
|
import { fetchAllDocs } from '../../lib/fetchAllDocs.js';
|
|
9
9
|
import { createApi } from '../../testSurface/api.js';
|
|
10
|
+
import { useOnTestReturn } from '../../testSurface/useOnTestReturn.js';
|
|
10
11
|
import { noMatchesLine, SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
11
12
|
import { Banner, EmptyState, StatusChip } from '../../ui/Feedback.js';
|
|
13
|
+
import { useDateFormatter } from '../../testSurface/format/useDateFormatter.js';
|
|
12
14
|
import { Button } from '../../ui/Button.js';
|
|
13
15
|
import { SearchInput } from '../../ui/Inputs.js';
|
|
14
16
|
import { SurfaceShell } from './SurfaceShell.js';
|
|
15
17
|
import { sanitizeReadinessDetail } from '../../sanitizeReadinessDetail.js';
|
|
16
18
|
import { groupTests, homeCard } from './home.model.js';
|
|
19
|
+
import { availableActions } from '../../testSurface/actions/actions.model.js';
|
|
20
|
+
import { LifecycleDialog } from '../../testSurface/actions/LifecycleAction.js';
|
|
21
|
+
import { useXpStepNav } from './useXpStepNav.js';
|
|
22
|
+
import { TestRowMenu } from './TestRowMenu.js';
|
|
23
|
+
import { useTestDocument } from '../../testSurface/surface/useTestDocument.js';
|
|
24
|
+
import { ConfirmDialog } from '../../ui/Dialog.js';
|
|
25
|
+
import { ACTIONS_COPY } from '../../testSurface/copy/actions.js';
|
|
26
|
+
import { API_MESSAGES } from '../../testSurface/copy/common.js';
|
|
27
|
+
import { READINESS_COPY } from '../../testSurface/copy/readiness.js';
|
|
17
28
|
const HOME_FIELDS = [
|
|
18
29
|
'name',
|
|
19
30
|
'kind',
|
|
@@ -24,13 +35,21 @@ const HOME_FIELDS = [
|
|
|
24
35
|
'decision',
|
|
25
36
|
'unitType',
|
|
26
37
|
'flagPoint',
|
|
27
|
-
'updatedAt'
|
|
38
|
+
'updatedAt',
|
|
39
|
+
'phase',
|
|
40
|
+
'allocation',
|
|
41
|
+
'startedAt'
|
|
28
42
|
];
|
|
29
43
|
// Typecheck fails if HomeTest gains a field the list request does not select (Payload always returns id).
|
|
30
44
|
const homeFieldsComplete = true;
|
|
31
45
|
void homeFieldsComplete;
|
|
32
46
|
const HOME_SELECT = HOME_FIELDS.map((field)=>`select[${field}]=true`).join('&');
|
|
33
|
-
export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = false, crumbs, flagPoints }) {
|
|
47
|
+
export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = false, canReadResults = true, crumbs, flagPoints }) {
|
|
48
|
+
useXpStepNav([
|
|
49
|
+
{
|
|
50
|
+
label: SURFACE_COPY.title
|
|
51
|
+
}
|
|
52
|
+
]);
|
|
34
53
|
const api = useMemo(()=>createApi(apiRoute), [
|
|
35
54
|
apiRoute
|
|
36
55
|
]);
|
|
@@ -39,13 +58,38 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
39
58
|
});
|
|
40
59
|
const [search, setSearch] = useState('');
|
|
41
60
|
const [attempt, setAttempt] = useState(0);
|
|
61
|
+
const reload = useCallback(()=>setAttempt((value)=>value + 1), []);
|
|
42
62
|
const [notice, setNotice] = useState();
|
|
43
63
|
const noticeRef = useRef(null);
|
|
64
|
+
const deletedIds = useRef(new Set());
|
|
65
|
+
const openDialogId = useRef(undefined);
|
|
66
|
+
const [selection, setSelection] = useState();
|
|
67
|
+
const [dialogTest, setDialogTest] = useState();
|
|
68
|
+
const refreshDeferred = useRef(false);
|
|
69
|
+
const returnToRow = useRef(null);
|
|
70
|
+
const actionList = useRef(null);
|
|
44
71
|
useLayoutEffect(()=>{
|
|
45
72
|
if (notice) noticeRef.current?.focus();
|
|
46
73
|
}, [
|
|
47
74
|
notice
|
|
48
75
|
]);
|
|
76
|
+
useEffect(()=>{
|
|
77
|
+
const previous = returnToRow.current;
|
|
78
|
+
const list = actionList.current;
|
|
79
|
+
const doc = noticeRef.current?.ownerDocument;
|
|
80
|
+
if (!previous || !doc || state.loading || openDialogId.current !== undefined) return;
|
|
81
|
+
if (previous.trigger?.isConnected) return;
|
|
82
|
+
returnToRow.current = null;
|
|
83
|
+
if (doc.activeElement !== doc.body && !doc.activeElement?.hasAttribute('data-dialog-focus-fallback')) return;
|
|
84
|
+
const row = [
|
|
85
|
+
...list?.querySelectorAll('[data-test-row]') ?? []
|
|
86
|
+
].find((item)=>item.dataset.testRow === previous.id);
|
|
87
|
+
const archived = row?.closest('details:not([open])');
|
|
88
|
+
const target = archived?.querySelector('summary') ?? row?.querySelector('.xp-tests-row-menu-trigger') ?? row?.querySelector('.xp-tests-row-action');
|
|
89
|
+
(target ?? doc.getElementById('xp-tests-search'))?.focus();
|
|
90
|
+
}, [
|
|
91
|
+
state
|
|
92
|
+
]);
|
|
49
93
|
useEffect(()=>{
|
|
50
94
|
const url = new URL(window.location.href);
|
|
51
95
|
const deleted = url.searchParams.get('deleted');
|
|
@@ -57,23 +101,35 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
57
101
|
window.history.replaceState(window.history.state, '', `${url.pathname}${url.search}${url.hash}`);
|
|
58
102
|
}
|
|
59
103
|
}, []);
|
|
104
|
+
useOnTestReturn(reload);
|
|
60
105
|
useEffect(()=>{
|
|
61
106
|
let active = true;
|
|
62
107
|
const controller = new AbortController();
|
|
63
|
-
setState({
|
|
64
|
-
|
|
65
|
-
|
|
108
|
+
setState((current)=>current.loading || current.error ? {
|
|
109
|
+
loading: true
|
|
110
|
+
} : current);
|
|
111
|
+
function settle(next) {
|
|
112
|
+
if (!active) return;
|
|
113
|
+
// A new group can remount a row. Let its open dialog finish before replacing the list.
|
|
114
|
+
if (openDialogId.current === undefined) {
|
|
115
|
+
setState(next);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
refreshDeferred.current = true;
|
|
119
|
+
if (!next.loading && !next.error) setDialogTest(next.tests.find((test)=>String(test.id) === openDialogId.current));
|
|
120
|
+
}
|
|
66
121
|
async function load() {
|
|
67
122
|
try {
|
|
68
123
|
const response = await fetchAllDocs(`${apiRoute.replace(/\/$/, '')}/xp-experiments?depth=0&sort=id&${HOME_SELECT}`, {
|
|
69
124
|
credentials: 'include',
|
|
125
|
+
cache: 'no-store',
|
|
70
126
|
signal: controller.signal
|
|
71
127
|
});
|
|
72
128
|
if (!response.ok) throw new Error('list');
|
|
73
129
|
const docs = response.docs.sort((a, b)=>(Date.parse(b.updatedAt ?? '') || 0) - (Date.parse(a.updatedAt ?? '') || 0));
|
|
74
130
|
if (!active) return;
|
|
75
|
-
const summary = await api.summary(docs.map((doc)=>doc.id));
|
|
76
|
-
const summaries = summary
|
|
131
|
+
const summary = canReadResults ? await api.summary(docs.map((doc)=>doc.id)) : undefined;
|
|
132
|
+
const summaries = summary?.ok ? summary.data ?? {} : {};
|
|
77
133
|
const ids = [
|
|
78
134
|
...new Set(docs.flatMap((doc)=>{
|
|
79
135
|
const item = summaries[doc.id];
|
|
@@ -101,16 +157,16 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
101
157
|
for (const goal of body?.docs ?? [])if (typeof goal.name === 'string' && goal.name.trim() && ids.includes(String(goal.id))) goalNames[String(goal.id)] = goal.name;
|
|
102
158
|
} catch {}
|
|
103
159
|
}
|
|
104
|
-
|
|
160
|
+
settle({
|
|
105
161
|
loading: false,
|
|
106
162
|
error: false,
|
|
107
|
-
tests: docs,
|
|
163
|
+
tests: docs.filter((doc)=>!deletedIds.current.has(String(doc.id))),
|
|
108
164
|
goalNames,
|
|
109
165
|
summaries,
|
|
110
|
-
summaryError:
|
|
166
|
+
summaryError: summary?.ok === false
|
|
111
167
|
});
|
|
112
168
|
} catch {
|
|
113
|
-
|
|
169
|
+
settle({
|
|
114
170
|
loading: false,
|
|
115
171
|
error: true
|
|
116
172
|
});
|
|
@@ -125,11 +181,42 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
125
181
|
api,
|
|
126
182
|
apiRoute,
|
|
127
183
|
attempt,
|
|
128
|
-
canManage
|
|
184
|
+
canManage,
|
|
185
|
+
canReadResults
|
|
129
186
|
]);
|
|
187
|
+
function showDialog(row, action) {
|
|
188
|
+
openDialogId.current = String(row.id);
|
|
189
|
+
returnToRow.current = {
|
|
190
|
+
id: String(row.id),
|
|
191
|
+
trigger: actionList.current?.ownerDocument.activeElement ?? null
|
|
192
|
+
};
|
|
193
|
+
setSelection({
|
|
194
|
+
row,
|
|
195
|
+
action
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function closeDialog() {
|
|
199
|
+
openDialogId.current = undefined;
|
|
200
|
+
setSelection(undefined);
|
|
201
|
+
setDialogTest(undefined);
|
|
202
|
+
if (refreshDeferred.current) {
|
|
203
|
+
refreshDeferred.current = false;
|
|
204
|
+
reload();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function handleDeleted(id, outcome) {
|
|
208
|
+
deletedIds.current.add(String(id));
|
|
209
|
+
setNotice({
|
|
210
|
+
outcome
|
|
211
|
+
});
|
|
212
|
+
setState((current)=>!current.loading && !current.error ? {
|
|
213
|
+
...current,
|
|
214
|
+
tests: current.tests.filter((test)=>String(test.id) !== String(id))
|
|
215
|
+
} : current);
|
|
216
|
+
}
|
|
130
217
|
const retry = /*#__PURE__*/ _jsx(Button, {
|
|
131
218
|
size: "sm",
|
|
132
|
-
onClick:
|
|
219
|
+
onClick: reload,
|
|
133
220
|
children: SURFACE_COPY.retry
|
|
134
221
|
});
|
|
135
222
|
const newTest = /*#__PURE__*/ _jsx(Button, {
|
|
@@ -140,6 +227,17 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
140
227
|
}),
|
|
141
228
|
children: SURFACE_COPY.newTest
|
|
142
229
|
});
|
|
230
|
+
const actionSurface = {
|
|
231
|
+
adminRoute,
|
|
232
|
+
apiRoute,
|
|
233
|
+
contentLocale,
|
|
234
|
+
canManage,
|
|
235
|
+
canReadResults,
|
|
236
|
+
isAdmin: false,
|
|
237
|
+
flagPoints: flagPoints ?? [],
|
|
238
|
+
attributeKeys: {},
|
|
239
|
+
metricSources: []
|
|
240
|
+
};
|
|
143
241
|
return /*#__PURE__*/ _jsxs(SurfaceShell, {
|
|
144
242
|
adminRoute: adminRoute,
|
|
145
243
|
crumbs: crumbs,
|
|
@@ -204,36 +302,51 @@ export function TestsHome({ adminRoute, apiRoute, contentLocale, canManage = fal
|
|
|
204
302
|
action: retry,
|
|
205
303
|
children: SURFACE_COPY.summaryError
|
|
206
304
|
}) : null,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
children:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
tests: current.tests.filter((test)=>String(test.id) !== String(id))
|
|
225
|
-
} : current);
|
|
226
|
-
},
|
|
227
|
-
flagPoints: flagPoints,
|
|
228
|
-
search: search,
|
|
229
|
-
clear: ()=>setSearch('')
|
|
305
|
+
/*#__PURE__*/ _jsx("div", {
|
|
306
|
+
ref: actionList,
|
|
307
|
+
children: state.tests.length === 0 ? /*#__PURE__*/ _jsx(EmptyState, {
|
|
308
|
+
action: newTest,
|
|
309
|
+
children: SURFACE_COPY.empty
|
|
310
|
+
}) : /*#__PURE__*/ _jsx(TestGroups, {
|
|
311
|
+
tests: state.tests,
|
|
312
|
+
summaries: state.summaries,
|
|
313
|
+
goalNames: state.goalNames,
|
|
314
|
+
adminRoute: adminRoute,
|
|
315
|
+
canManage: canManage,
|
|
316
|
+
canReadResults: canReadResults,
|
|
317
|
+
onSelect: showDialog,
|
|
318
|
+
flagPoints: flagPoints,
|
|
319
|
+
search: search,
|
|
320
|
+
clear: ()=>setSearch('')
|
|
321
|
+
})
|
|
230
322
|
})
|
|
231
323
|
]
|
|
232
|
-
})
|
|
324
|
+
}),
|
|
325
|
+
selection?.action.id === 'delete' ? /*#__PURE__*/ _jsx(DeleteTest, {
|
|
326
|
+
fromMenu: true,
|
|
327
|
+
test: dialogTest ?? selection.row,
|
|
328
|
+
canManage: canManage,
|
|
329
|
+
apiRoute: apiRoute,
|
|
330
|
+
contentLocale: contentLocale,
|
|
331
|
+
onDeleted: (outcome)=>handleDeleted(selection.row.id, outcome),
|
|
332
|
+
onDialogChange: (open)=>{
|
|
333
|
+
if (!open) closeDialog();
|
|
334
|
+
},
|
|
335
|
+
onStatusChanged: reload
|
|
336
|
+
}) : selection ? /*#__PURE__*/ _jsx(ListLifecycleDialog, {
|
|
337
|
+
selection: selection,
|
|
338
|
+
surface: actionSurface,
|
|
339
|
+
onClose: ()=>{
|
|
340
|
+
closeDialog();
|
|
341
|
+
reload();
|
|
342
|
+
}
|
|
343
|
+
}) : null
|
|
233
344
|
]
|
|
234
345
|
});
|
|
235
346
|
}
|
|
236
|
-
function TestGroups({ tests, summaries, goalNames, adminRoute,
|
|
347
|
+
function TestGroups({ tests, summaries, goalNames, adminRoute, canManage, canReadResults, onSelect, flagPoints, search, clear }) {
|
|
348
|
+
const formatDate = useDateFormatter();
|
|
349
|
+
const now = Date.now();
|
|
237
350
|
const groups = groupTests(tests, summaries, search);
|
|
238
351
|
if (!groups.some((group)=>group.tests.length)) return /*#__PURE__*/ _jsxs("div", {
|
|
239
352
|
className: "xp-tests-no-matches",
|
|
@@ -255,9 +368,28 @@ function TestGroups({ tests, summaries, goalNames, adminRoute, apiRoute, content
|
|
|
255
368
|
const rows = /*#__PURE__*/ _jsx("div", {
|
|
256
369
|
className: "xp-tests-list",
|
|
257
370
|
children: group.tests.map((test)=>{
|
|
258
|
-
const
|
|
371
|
+
const summary = summaries[test.id];
|
|
372
|
+
const card = homeCard(test, summary, adminRoute, {
|
|
373
|
+
formatDate,
|
|
374
|
+
now,
|
|
375
|
+
flagPoints,
|
|
376
|
+
goalNames,
|
|
377
|
+
canReadResults
|
|
378
|
+
});
|
|
379
|
+
const ready = test.status === 'draft' && summary?.ready === true;
|
|
380
|
+
const actions = availableActions({
|
|
381
|
+
...test,
|
|
382
|
+
canManage,
|
|
383
|
+
canReadResults
|
|
384
|
+
});
|
|
385
|
+
const primary = ready ? actions.find((action)=>action.id === 'start') : undefined;
|
|
386
|
+
const menu = actions.filter((action)=>action.id !== 'start' || test.status === 'stopped').map((action)=>action.id === 'start' && summary?.ready === false ? {
|
|
387
|
+
...action,
|
|
388
|
+
unavailable: card.line
|
|
389
|
+
} : action);
|
|
259
390
|
return /*#__PURE__*/ _jsxs("article", {
|
|
260
391
|
className: "xp-tests-row",
|
|
392
|
+
"data-test-row": String(test.id),
|
|
261
393
|
children: [
|
|
262
394
|
/*#__PURE__*/ _jsxs("div", {
|
|
263
395
|
className: "xp-tests-row-main",
|
|
@@ -276,7 +408,7 @@ function TestGroups({ tests, summaries, goalNames, adminRoute, apiRoute, content
|
|
|
276
408
|
/*#__PURE__*/ _jsx("span", {
|
|
277
409
|
title: card.pill.tooltip,
|
|
278
410
|
children: /*#__PURE__*/ _jsx(StatusChip, {
|
|
279
|
-
status: test.status
|
|
411
|
+
status: ready ? 'ready' : test.status
|
|
280
412
|
})
|
|
281
413
|
})
|
|
282
414
|
]
|
|
@@ -296,21 +428,28 @@ function TestGroups({ tests, summaries, goalNames, adminRoute, apiRoute, content
|
|
|
296
428
|
]
|
|
297
429
|
}),
|
|
298
430
|
/*#__PURE__*/ _jsxs("div", {
|
|
299
|
-
className: "xp-ui-button-group",
|
|
431
|
+
className: "xp-ui-button-group xp-tests-row-actions",
|
|
300
432
|
children: [
|
|
301
|
-
/*#__PURE__*/ _jsx(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
433
|
+
primary ? /*#__PURE__*/ _jsx(Button, {
|
|
434
|
+
className: "xp-tests-row-action",
|
|
435
|
+
variant: "primary",
|
|
436
|
+
size: "sm",
|
|
437
|
+
onClick: (event)=>{
|
|
438
|
+
event.currentTarget.focus();
|
|
439
|
+
onSelect(test, primary);
|
|
440
|
+
},
|
|
441
|
+
children: primary.label
|
|
442
|
+
}) : /*#__PURE__*/ _jsx(Button, {
|
|
309
443
|
className: "xp-tests-row-action",
|
|
310
444
|
size: "sm",
|
|
311
445
|
href: card.href,
|
|
312
446
|
children: card.action
|
|
313
|
-
})
|
|
447
|
+
}),
|
|
448
|
+
menu.length ? /*#__PURE__*/ _jsx(TestRowMenu, {
|
|
449
|
+
name: test.name,
|
|
450
|
+
actions: menu,
|
|
451
|
+
onSelect: (action)=>onSelect(test, action)
|
|
452
|
+
}) : null
|
|
314
453
|
]
|
|
315
454
|
})
|
|
316
455
|
]
|
|
@@ -329,10 +468,11 @@ function TestGroups({ tests, summaries, goalNames, adminRoute, apiRoute, content
|
|
|
329
468
|
})
|
|
330
469
|
]
|
|
331
470
|
});
|
|
332
|
-
return
|
|
471
|
+
return group.key === 'archived' ? /*#__PURE__*/ _jsxs("details", {
|
|
333
472
|
className: "xp-tests-group",
|
|
334
473
|
children: [
|
|
335
474
|
/*#__PURE__*/ _jsx("summary", {
|
|
475
|
+
tabIndex: 0,
|
|
336
476
|
children: /*#__PURE__*/ _jsxs("h2", {
|
|
337
477
|
className: "xp-tests-group-head",
|
|
338
478
|
children: [
|
|
@@ -361,3 +501,35 @@ function TestGroups({ tests, summaries, goalNames, adminRoute, apiRoute, content
|
|
|
361
501
|
})
|
|
362
502
|
});
|
|
363
503
|
}
|
|
504
|
+
function ListLifecycleDialog({ selection: { row, action }, surface, onClose }) {
|
|
505
|
+
const test = useTestDocument(row.id, {
|
|
506
|
+
apiRoute: surface.apiRoute,
|
|
507
|
+
contentLocale: surface.contentLocale
|
|
508
|
+
});
|
|
509
|
+
const doc = test.doc;
|
|
510
|
+
const [opened, setOpened] = useState(false);
|
|
511
|
+
const canOpen = !!doc && doc.status === row.status && (row.phase === undefined || doc.phase === row.phase) && availableActions({
|
|
512
|
+
...doc,
|
|
513
|
+
decision: doc.decision,
|
|
514
|
+
canManage: surface.canManage,
|
|
515
|
+
canReadResults: surface.canReadResults
|
|
516
|
+
}).some((item)=>item.id === action.id && !item.unavailable);
|
|
517
|
+
if (!opened && canOpen) setOpened(true);
|
|
518
|
+
if (opened) return /*#__PURE__*/ _jsx(LifecycleDialog, {
|
|
519
|
+
action: action,
|
|
520
|
+
test: test,
|
|
521
|
+
surface: surface,
|
|
522
|
+
onClose: onClose
|
|
523
|
+
});
|
|
524
|
+
const checking = test.loadState === 'loading';
|
|
525
|
+
return /*#__PURE__*/ _jsx(ConfirmDialog, {
|
|
526
|
+
title: action.confirm.title,
|
|
527
|
+
cancelLabel: ACTIONS_COPY.cancel,
|
|
528
|
+
onClose: onClose,
|
|
529
|
+
error: checking ? undefined : test.preflightRead?.message ?? (doc ? API_MESSAGES.roundChanged : API_MESSAGES.unreadable),
|
|
530
|
+
children: checking ? /*#__PURE__*/ _jsx("p", {
|
|
531
|
+
role: "status",
|
|
532
|
+
children: READINESS_COPY.checking
|
|
533
|
+
}) : null
|
|
534
|
+
});
|
|
535
|
+
}
|
|
@@ -52,6 +52,7 @@ function SurfacePage(props) {
|
|
|
52
52
|
apiRoute: props.apiRoute,
|
|
53
53
|
contentLocale: props.contentLocale,
|
|
54
54
|
canManage: props.canManage,
|
|
55
|
+
canReadResults: props.canReadResults,
|
|
55
56
|
flagPoints: props.flagPoints,
|
|
56
57
|
crumbs: crumbs
|
|
57
58
|
});
|
|
@@ -79,7 +80,7 @@ function SurfacePage(props) {
|
|
|
79
80
|
title: title,
|
|
80
81
|
children: props.route === 'new' ? /*#__PURE__*/ _jsx(NewTest, {
|
|
81
82
|
surface: surface,
|
|
82
|
-
|
|
83
|
+
blockPageCollections: props.blockPageCollections
|
|
83
84
|
}) : props.id === undefined ? null : /*#__PURE__*/ _jsx(ResultsRoute, {
|
|
84
85
|
id: props.id,
|
|
85
86
|
surface: surface,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import { ConfirmDialog } from '../../../ui/Dialog.js';
|
|
5
|
+
import { actionTitle } from '../../../testSurface/copy/actions.js';
|
|
6
|
+
import { GOALS_COPY as C } from '../../copy/goals.js';
|
|
7
|
+
import { deleteGoal } from './data.js';
|
|
8
|
+
export function DeleteGoalDialog({ goal, apiRoute, onClose, onDeleted }) {
|
|
9
|
+
const [busy, setBusy] = useState(false);
|
|
10
|
+
const [error, setError] = useState();
|
|
11
|
+
const inFlight = useRef(false);
|
|
12
|
+
async function remove() {
|
|
13
|
+
if (inFlight.current) return;
|
|
14
|
+
inFlight.current = true;
|
|
15
|
+
setBusy(true);
|
|
16
|
+
setError(undefined);
|
|
17
|
+
try {
|
|
18
|
+
await deleteGoal(apiRoute, goal.id);
|
|
19
|
+
onDeleted();
|
|
20
|
+
} catch (cause) {
|
|
21
|
+
setError(cause instanceof Error ? cause.message : C.deleteError);
|
|
22
|
+
inFlight.current = false;
|
|
23
|
+
setBusy(false);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/ _jsx(ConfirmDialog, {
|
|
27
|
+
open: true,
|
|
28
|
+
title: actionTitle(C.confirmDelete, goal.name),
|
|
29
|
+
onClose: onClose,
|
|
30
|
+
cancelLabel: C.cancel,
|
|
31
|
+
busy: busy,
|
|
32
|
+
busyLabel: C.deleting,
|
|
33
|
+
description: C.deleteBody,
|
|
34
|
+
error: error,
|
|
35
|
+
confirm: {
|
|
36
|
+
label: C.confirmDelete,
|
|
37
|
+
destructive: true,
|
|
38
|
+
disabled: busy,
|
|
39
|
+
onClick: remove
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|