@delmaredigital/payload-experiments 0.4.0-rc.2 → 0.4.0-rc.4
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 +283 -775
- 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 +6 -1
- package/dist/admin/copy/goals.js +10 -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 +4 -3
- 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 +69 -15
- 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 +13 -13
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +8 -8
- 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/picker/clickGoalPicker.model.d.ts +8 -1
- package/dist/goals/picker/clickGoalPicker.model.js +20 -2
- package/dist/goals/picker/copy.d.ts +6 -2
- package/dist/goals/picker/copy.js +11 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/goals/validate.js +3 -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/hooks/puckGoals.d.ts +2 -0
- package/dist/hooks/puckGoals.js +34 -10
- 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 +69 -9
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +317 -51
- package/dist/puck/editor/ResultsReadout.js +3 -5
- package/dist/puck/editor/VersionBuilder.js +2 -2
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -3
- package/dist/puck/editor/copy.d.ts +18 -2
- package/dist/puck/editor/copy.js +19 -3
- package/dist/puck/editor/editor.chrome.css +33 -0
- package/dist/puck/editor/editor.css +39 -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/localPlacements.d.ts +2 -0
- package/dist/puck/editor/localPlacements.js +29 -0
- package/dist/puck/editor/placementsCache.d.ts +19 -0
- package/dist/puck/editor/placementsCache.js +83 -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 +4 -5
- package/dist/{admin → testSurface}/copy/common.d.ts +2 -0
- package/dist/{admin → testSurface}/copy/common.js +2 -0
- package/dist/{admin → testSurface}/copy/readiness.d.ts +3 -0
- package/dist/{admin → testSurface}/copy/readiness.js +3 -0
- package/dist/{admin → testSurface}/copy/testPage.d.ts +3 -0
- package/dist/{admin → testSurface}/copy/testPage.js +7 -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/results/results.css +64 -0
- package/dist/{admin → testSurface}/surface/contracts.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +6 -6
- package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
- package/dist/{admin → testSurface}/surface/readiness/useTransition.js +1 -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/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +3 -2
- package/dist/{admin → testSurface}/surface/test/Section.js +9 -8
- package/dist/testSurface/surface/test/TestSurface.d.ts +18 -0
- package/dist/testSurface/surface/test/TestSurface.js +152 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +12 -6
- package/dist/testSurface/surface/test/testPage.css +92 -0
- package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +5 -1
- package/dist/{admin → testSurface}/surface/useTestDocument.js +34 -3
- package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
- 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/start.js +2 -2
- package/dist/types/endpoints.d.ts +1 -1
- 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 +3 -3
- package/dist/ui/Tabs.js +35 -33
- package/dist/ui/ui.css +6 -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/setting/setting.css +0 -17
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- 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/ActionDialogs.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/Banner.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/useTransition.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/AdvancedSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/LengthSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/LengthSection.js +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/Rail.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/Section.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.js +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
package/dist/admin/LayerUsage.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { FieldDescription, FieldLabel, useDocumentInfo } from '@payloadcms/ui';
|
|
4
4
|
import { useLayerExperiments } from './useLayerUsage.js';
|
|
5
|
-
import { statusLabel } from '
|
|
5
|
+
import { statusLabel } from '../testSurface/labels.js';
|
|
6
6
|
import { HISTORY_COPY, layerRow, layerSummary } from './copy/history.js';
|
|
7
7
|
export function LayerUsage({ field, path }) {
|
|
8
8
|
const { id } = useDocumentInfo();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { SelectInput, useField } from '@payloadcms/ui';
|
|
4
|
-
import { metricSourceHint, metricSourceOptions, sourceFor } from '
|
|
5
|
-
import { METRICS_COPY } from '
|
|
4
|
+
import { metricSourceHint, metricSourceOptions, sourceFor } from '../testSurface/metricSource.model.js';
|
|
5
|
+
import { METRICS_COPY } from '../testSurface/copy/metrics.js';
|
|
6
6
|
export function MetricSourceSelect({ path, field, readOnly }) {
|
|
7
7
|
const { value, setValue } = useField({
|
|
8
8
|
path
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useConfig, useDocumentInfo } from '@payloadcms/ui';
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
5
|
import { formatAdminURL } from 'payload/shared';
|
|
6
|
-
import { createApi } from '
|
|
6
|
+
import { createApi } from '../testSurface/api.js';
|
|
7
7
|
import { pageStatusCopy } from './placementStatus.model.js';
|
|
8
8
|
/** Manage-only endpoint: access-filtered editors see no status or error text. */ export function PlacementStatus(_props) {
|
|
9
9
|
const { id, collectionSlug } = useDocumentInfo();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { surfaceUrls } from '
|
|
3
|
+
import { surfaceUrls } from '../testSurface/surfaceUrls.js';
|
|
4
4
|
import './theme.css';
|
|
5
5
|
import './dashboard.css';
|
|
6
6
|
import { Card, useAuth, useConfig } from '@payloadcms/ui';
|
|
7
|
-
import { SURFACE_COPY } from '
|
|
7
|
+
import { SURFACE_COPY } from '../testSurface/copy/surface.js';
|
|
8
8
|
/** @deprecated Retained for existing import maps until 0.5.0. */ export function TestsDashboardCards() {
|
|
9
9
|
const { config } = useConfig();
|
|
10
10
|
const { permissions } = useAuth();
|
|
@@ -1,10 +1,10 @@
|
|
|
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 './theme.css';
|
|
5
5
|
import { Link, NavGroup, useAuth, useConfig } from '@payloadcms/ui';
|
|
6
6
|
import { usePathname } from 'next/navigation.js';
|
|
7
|
-
import { SURFACE_COPY } from '
|
|
7
|
+
import { SURFACE_COPY } from '../testSurface/copy/surface.js';
|
|
8
8
|
/** @deprecated Retained for existing import maps until 0.5.0. */ function TestsNav({ isOpen = true }) {
|
|
9
9
|
const { config } = useConfig();
|
|
10
10
|
const { permissions } = useAuth();
|
|
@@ -4,10 +4,10 @@ import { Banner, Button, ConfirmationModal, toast, useModal, useFormInitializing
|
|
|
4
4
|
import { formatAdminURL } from 'payload/shared';
|
|
5
5
|
import { useEffect, useId, useRef, useState } from 'react';
|
|
6
6
|
import { copyOriginalIntoVersion, syncExperimentSlots, unwrapExperimentBlock } from '../../blocks/formState.js';
|
|
7
|
-
import { BLOCK_COPY, blockSyncNotice, blockUnwrapNotice, blockDeleteConfirmation, blockUnwrapConfirmation, blockRunningUnwrap, blockDecidedUnwrap, blockFinishedCopy } from '
|
|
8
|
-
import { API_MESSAGES } from '
|
|
7
|
+
import { BLOCK_COPY, blockSyncNotice, blockUnwrapNotice, blockDeleteConfirmation, blockUnwrapConfirmation, blockRunningUnwrap, blockDecidedUnwrap, blockFinishedCopy } from '../../admin/copy/blocks.js';
|
|
8
|
+
import { API_MESSAGES } from '../../testSurface/copy/common.js';
|
|
9
9
|
import { isOrphan, liveStatus, slotLabel, statusSentence } from './model.js';
|
|
10
|
-
import { createApi } from '
|
|
10
|
+
import { createApi } from '../../testSurface/api.js';
|
|
11
11
|
import { useBlockStatus, setBlockStatus } from './statusCache.js';
|
|
12
12
|
import { useBlockForm } from './useBlockForm.js';
|
|
13
13
|
import { BlockChangedError, RefusalError } from './formApi.js';
|
|
@@ -6,9 +6,9 @@ import { useMemo, useRef, useState } from 'react';
|
|
|
6
6
|
import { hostBlocks } from '../../blocks/model.js';
|
|
7
7
|
import { wrapExperimentBlock } from '../../blocks/formState.js';
|
|
8
8
|
import { CreateRefused, createTest } from '../../puck/editor/createTest.js';
|
|
9
|
-
import { createApi } from '
|
|
10
|
-
import { BLOCK_COPY, blockSaveNotice, blockTestName } from '
|
|
11
|
-
import { API_MESSAGES } from '
|
|
9
|
+
import { createApi } from '../../testSurface/api.js';
|
|
10
|
+
import { BLOCK_COPY, blockSaveNotice, blockTestName } from '../../admin/copy/blocks.js';
|
|
11
|
+
import { API_MESSAGES } from '../../testSurface/copy/common.js';
|
|
12
12
|
import { adaptClientBlocksField, BlockChangedError, dataAt, experimentBlockSlug, findClientBlocksField, replaceBlockRow, wrapMode } from './formApi.js';
|
|
13
13
|
import { blockChoices, labelText } from './model.js';
|
|
14
14
|
export function TestBlockField(props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EXPERIMENT_BLOCK_SLUG, hostBlocks } from '../../blocks/model.js';
|
|
2
|
-
import { BLOCK_COPY } from '
|
|
2
|
+
import { BLOCK_COPY } from '../../admin/copy/blocks.js';
|
|
3
3
|
/** The only form-state failure with block-specific editor copy. */ export class BlockChangedError extends Error {
|
|
4
4
|
constructor(){
|
|
5
5
|
super(BLOCK_COPY.blockChanged);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hostBlocks } from '../../blocks/model.js';
|
|
2
|
-
import { BLOCK_COPY, blockDecidedStatus, blockDraftStatus, blockFinishedStatus, blockPosition } from '
|
|
2
|
+
import { BLOCK_COPY, blockDecidedStatus, blockDraftStatus, blockFinishedStatus, blockPosition } from '../../admin/copy/blocks.js';
|
|
3
3
|
export function liveStatus(status) {
|
|
4
4
|
return !!status && 'status' in status;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useSyncExternalStore } from 'react';
|
|
2
|
-
import { createApi } from '
|
|
2
|
+
import { createApi } from '../../testSurface/api.js';
|
|
3
3
|
const cache = new Map();
|
|
4
4
|
// Subscribers do not create status entries: a label alone owns no cached data.
|
|
5
5
|
const listeners = new Map();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import '../theme.css';
|
|
4
|
-
import { theme } from '
|
|
4
|
+
import { theme } from '../../testSurface/theme.js';
|
|
5
5
|
export function RootViewMessage({ children, alert = false }) {
|
|
6
6
|
return /*#__PURE__*/ _jsx("div", {
|
|
7
7
|
role: alert ? 'alert' : undefined,
|
|
@@ -13,8 +13,8 @@ export declare const BLOCK_COPY: {
|
|
|
13
13
|
unwrap: string;
|
|
14
14
|
removeAndUnwrap: string;
|
|
15
15
|
deleteAndUnwrap: string;
|
|
16
|
-
alreadyDeleted:
|
|
17
|
-
noLongerDraft:
|
|
16
|
+
alreadyDeleted: "This test was already deleted. Reload the page.";
|
|
17
|
+
noLongerDraft: "This test is no longer a draft. Reload the page.";
|
|
18
18
|
finishUnwrap: string;
|
|
19
19
|
deleted: string;
|
|
20
20
|
discarded: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { API_MESSAGES } from '../../testSurface/copy/common.js';
|
|
1
2
|
export const BLOCK_COPY = {
|
|
2
3
|
testBlock: 'Test a block on this page',
|
|
3
4
|
pick: 'Choose a block',
|
|
@@ -13,8 +14,8 @@ export const BLOCK_COPY = {
|
|
|
13
14
|
unwrap: 'Unwrap',
|
|
14
15
|
removeAndUnwrap: 'Remove the test and unwrap',
|
|
15
16
|
deleteAndUnwrap: 'Delete and unwrap',
|
|
16
|
-
alreadyDeleted:
|
|
17
|
-
noLongerDraft:
|
|
17
|
+
alreadyDeleted: API_MESSAGES.testAlreadyDeleted,
|
|
18
|
+
noLongerDraft: API_MESSAGES.testNoLongerDraft,
|
|
18
19
|
finishUnwrap: 'The test was removed; use Unwrap to finish.',
|
|
19
20
|
deleted: "This block's test was deleted; the page shows the Original.",
|
|
20
21
|
discarded: 'This test has ended; the page shows the Original.',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const GOALS_COPY: {
|
|
2
2
|
readonly slugRule: "Use 1–64 lowercase letters, numbers, underscores or hyphens, starting with a letter or number.";
|
|
3
3
|
readonly duplicateSlug: "Another goal already uses this short name. Change it under Advanced.";
|
|
4
|
+
readonly duplicateSlugMain: "Another goal already uses this short name. Choose another.";
|
|
4
5
|
readonly title: "Goals";
|
|
5
6
|
readonly goal: "Goal";
|
|
6
7
|
readonly newGoal: "New goal";
|
|
@@ -12,6 +13,7 @@ export declare const GOALS_COPY: {
|
|
|
12
13
|
readonly decrease: "Less is better";
|
|
13
14
|
readonly usedBy: "Used by";
|
|
14
15
|
readonly status: "Status";
|
|
16
|
+
readonly showLess: "Show less";
|
|
15
17
|
readonly inUse: "In use";
|
|
16
18
|
readonly unused: "Not used yet";
|
|
17
19
|
readonly empty: "No goals yet. A goal is what a test tries to improve.";
|
|
@@ -54,8 +56,11 @@ export declare const GOALS_COPY: {
|
|
|
54
56
|
readonly deleteTitle: "Delete this goal?";
|
|
55
57
|
readonly deleteBody: "This cannot be undone.";
|
|
56
58
|
readonly confirmDelete: "Delete";
|
|
59
|
+
readonly thoseTests: "those tests";
|
|
60
|
+
readonly deleteLockedEnd: " first.";
|
|
57
61
|
};
|
|
58
62
|
export declare function goalUsedBy(count: number): string;
|
|
59
63
|
export declare function goalInUse(count: number): string;
|
|
60
|
-
export declare function
|
|
64
|
+
export declare function goalDeleteLockedStart(count: number): string;
|
|
61
65
|
export declare function goalsNoMatches(search: string): string;
|
|
66
|
+
export declare function goalShowAll(count: number): string;
|
package/dist/admin/copy/goals.js
CHANGED
|
@@ -2,6 +2,7 @@ import { CLICK_GOAL_COPY } from '../../goals/picker/copy.js';
|
|
|
2
2
|
export const GOALS_COPY = {
|
|
3
3
|
slugRule: CLICK_GOAL_COPY.slugRule,
|
|
4
4
|
duplicateSlug: CLICK_GOAL_COPY.duplicateSlug,
|
|
5
|
+
duplicateSlugMain: 'Another goal already uses this short name. Choose another.',
|
|
5
6
|
title: 'Goals',
|
|
6
7
|
goal: 'Goal',
|
|
7
8
|
newGoal: 'New goal',
|
|
@@ -13,6 +14,7 @@ export const GOALS_COPY = {
|
|
|
13
14
|
decrease: 'Less is better',
|
|
14
15
|
usedBy: 'Used by',
|
|
15
16
|
status: 'Status',
|
|
17
|
+
showLess: 'Show less',
|
|
16
18
|
inUse: 'In use',
|
|
17
19
|
unused: 'Not used yet',
|
|
18
20
|
empty: 'No goals yet. A goal is what a test tries to improve.',
|
|
@@ -54,7 +56,9 @@ export const GOALS_COPY = {
|
|
|
54
56
|
fields: 'Goal details',
|
|
55
57
|
deleteTitle: 'Delete this goal?',
|
|
56
58
|
deleteBody: 'This cannot be undone.',
|
|
57
|
-
confirmDelete: 'Delete'
|
|
59
|
+
confirmDelete: 'Delete',
|
|
60
|
+
thoseTests: 'those tests',
|
|
61
|
+
deleteLockedEnd: ' first.'
|
|
58
62
|
};
|
|
59
63
|
export function goalUsedBy(count) {
|
|
60
64
|
return `Used by ${count} ${count === 1 ? 'test' : 'tests'}`;
|
|
@@ -62,9 +66,12 @@ export function goalUsedBy(count) {
|
|
|
62
66
|
export function goalInUse(count) {
|
|
63
67
|
return `In use by ${count} ${count === 1 ? 'test' : 'tests'}`;
|
|
64
68
|
}
|
|
65
|
-
export function
|
|
66
|
-
return `${goalUsedBy(count)}. Remove it from
|
|
69
|
+
export function goalDeleteLockedStart(count) {
|
|
70
|
+
return `${goalUsedBy(count)}. Remove it from `;
|
|
67
71
|
}
|
|
68
72
|
export function goalsNoMatches(search) {
|
|
69
73
|
return `No goals match “${search}”.`;
|
|
70
74
|
}
|
|
75
|
+
export function goalShowAll(count) {
|
|
76
|
+
return `Show all ${count}`;
|
|
77
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Button, FieldError, FieldLabel, SelectInput,
|
|
3
|
+
import { Button, FieldDescription, FieldError, FieldLabel, SelectInput, useAuth, useConfig, useField } from '@payloadcms/ui';
|
|
4
4
|
import { useId } from 'react';
|
|
5
5
|
import { useClickGoalPicker } from '../../goals/picker/useClickGoalPicker.js';
|
|
6
|
+
import { clickGoalOptions } from '../../goals/picker/clickGoalPicker.model.js';
|
|
6
7
|
import { CLICK_GOAL_COPY as C } from '../../goals/picker/copy.js';
|
|
7
8
|
import '../theme.css';
|
|
8
9
|
import './xpGoalField.css';
|
|
10
|
+
// Payload 3's declaration requires `name`, though SelectInput only consumes `path`.
|
|
11
|
+
const GoalSelectInput = SelectInput;
|
|
9
12
|
export function XpGoalField({ path, field, readOnly }) {
|
|
10
13
|
const { value, setValue, showError } = useField({
|
|
11
14
|
path
|
|
@@ -15,9 +18,11 @@ export function XpGoalField({ path, field, readOnly }) {
|
|
|
15
18
|
const access = permissions?.collections?.['xp-experiments'];
|
|
16
19
|
const locked = Boolean(readOnly || field.admin?.readOnly);
|
|
17
20
|
const picker = useClickGoalPicker(config.routes.api, {
|
|
18
|
-
enabled: access?.update === true,
|
|
21
|
+
enabled: access?.update === true && !locked,
|
|
19
22
|
onSelect: setValue
|
|
20
23
|
});
|
|
24
|
+
const { options, missing } = clickGoalOptions(picker.status, picker.goals, value ?? '');
|
|
25
|
+
const readonly = locked || picker.status === 'not-manager';
|
|
21
26
|
const id = useId(), namePath = `${id}-name`, slugPath = `${id}-slug`;
|
|
22
27
|
const stopEnter = (event)=>{
|
|
23
28
|
if (event.key === 'Enter') {
|
|
@@ -28,140 +33,161 @@ export function XpGoalField({ path, field, readOnly }) {
|
|
|
28
33
|
return /*#__PURE__*/ _jsxs("div", {
|
|
29
34
|
className: "field-type xp-goal-field",
|
|
30
35
|
children: [
|
|
31
|
-
/*#__PURE__*/
|
|
32
|
-
path: path,
|
|
33
|
-
label: field.label ?? C.label,
|
|
34
|
-
description: field.admin?.description,
|
|
35
|
-
required: field.required,
|
|
36
|
-
readOnly: locked,
|
|
37
|
-
value: value ?? '',
|
|
38
|
-
showError: showError,
|
|
39
|
-
Error: /*#__PURE__*/ _jsx(FieldError, {
|
|
40
|
-
path: path,
|
|
41
|
-
showError: showError
|
|
42
|
-
}),
|
|
43
|
-
onChange: (event)=>{
|
|
44
|
-
if (!locked) setValue(event.currentTarget.value);
|
|
45
|
-
}
|
|
46
|
-
}),
|
|
47
|
-
picker.canManage && !locked ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
36
|
+
readonly ? /*#__PURE__*/ _jsxs("div", {
|
|
48
37
|
children: [
|
|
49
|
-
/*#__PURE__*/ _jsxs("
|
|
50
|
-
className: "
|
|
38
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
39
|
+
className: "field-label",
|
|
40
|
+
id: `${id}-label`,
|
|
51
41
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
value: picker.goals.some((goal)=>goal.slug === value) ? value : undefined,
|
|
57
|
-
options: picker.goals.map((goal)=>({
|
|
58
|
-
value: goal.slug,
|
|
59
|
-
label: goal.name
|
|
60
|
-
})),
|
|
61
|
-
placeholder: C.choose,
|
|
62
|
-
isClearable: false,
|
|
63
|
-
label: C.choose,
|
|
64
|
-
onChange: (option)=>{
|
|
65
|
-
if (option && !Array.isArray(option)) setValue(String(option.value));
|
|
66
|
-
}
|
|
67
|
-
}),
|
|
68
|
-
!picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
|
|
69
|
-
type: "button",
|
|
70
|
-
margin: false,
|
|
71
|
-
buttonStyle: "secondary",
|
|
72
|
-
onClick: picker.open,
|
|
73
|
-
children: C.newGoal
|
|
42
|
+
C.label,
|
|
43
|
+
field.required ? /*#__PURE__*/ _jsx("span", {
|
|
44
|
+
className: "required",
|
|
45
|
+
children: "*"
|
|
74
46
|
}) : null
|
|
75
47
|
]
|
|
76
48
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
children: C.
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
open: picker.panel.advanced,
|
|
107
|
-
onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
|
|
108
|
-
children: [
|
|
109
|
-
/*#__PURE__*/ _jsx("summary", {
|
|
110
|
-
children: C.advanced
|
|
111
|
-
}),
|
|
112
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
113
|
-
className: "field-type text",
|
|
114
|
-
children: [
|
|
115
|
-
/*#__PURE__*/ _jsx(FieldLabel, {
|
|
116
|
-
path: slugPath,
|
|
117
|
-
label: C.slug
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ _jsx("input", {
|
|
120
|
-
id: `field-${slugPath}`,
|
|
121
|
-
value: picker.panel.slug,
|
|
122
|
-
disabled: picker.panel.pending,
|
|
123
|
-
onKeyDown: stopEnter,
|
|
124
|
-
"aria-invalid": Boolean(picker.panel.errors.slug) || undefined,
|
|
125
|
-
"aria-describedby": picker.panel.errors.slug ? `${id}-slug-error` : undefined,
|
|
126
|
-
onChange: (event)=>picker.setSlug(event.currentTarget.value)
|
|
127
|
-
}),
|
|
128
|
-
picker.panel.errors.slug ? /*#__PURE__*/ _jsx("p", {
|
|
129
|
-
id: `${id}-slug-error`,
|
|
130
|
-
role: "alert",
|
|
131
|
-
children: picker.panel.errors.slug
|
|
132
|
-
}) : null
|
|
133
|
-
]
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
|
|
138
|
-
role: "alert",
|
|
139
|
-
children: picker.panel.errors.general
|
|
140
|
-
}) : null,
|
|
141
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
142
|
-
className: "xp-goal-field__actions",
|
|
143
|
-
children: [
|
|
144
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
145
|
-
type: "button",
|
|
146
|
-
margin: false,
|
|
147
|
-
buttonStyle: "primary",
|
|
148
|
-
disabled: picker.panel.pending || !picker.panel.name.trim(),
|
|
149
|
-
onClick: ()=>void picker.create(),
|
|
150
|
-
children: C.createGoal
|
|
151
|
-
}),
|
|
152
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
153
|
-
type: "button",
|
|
154
|
-
margin: false,
|
|
155
|
-
buttonStyle: "secondary",
|
|
156
|
-
disabled: picker.panel.pending,
|
|
157
|
-
onClick: picker.cancel,
|
|
158
|
-
children: C.cancel
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
})
|
|
162
|
-
]
|
|
49
|
+
/*#__PURE__*/ _jsx("p", {
|
|
50
|
+
"aria-labelledby": `${id}-label`,
|
|
51
|
+
children: value || C.none
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}) : /*#__PURE__*/ _jsxs("div", {
|
|
55
|
+
className: "xp-goal-field__row",
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ _jsx(GoalSelectInput, {
|
|
58
|
+
path: path,
|
|
59
|
+
className: "xp-goal-field__select",
|
|
60
|
+
value: value ?? '',
|
|
61
|
+
options: options,
|
|
62
|
+
label: C.label,
|
|
63
|
+
required: field.required,
|
|
64
|
+
readOnly: picker.status !== 'ready',
|
|
65
|
+
isClearable: false,
|
|
66
|
+
placeholder: C.none,
|
|
67
|
+
showError: showError,
|
|
68
|
+
onChange: (option)=>{
|
|
69
|
+
if (picker.status === 'ready' && option && !Array.isArray(option)) setValue(String(option.value));
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
picker.canManage && !picker.panel.open ? /*#__PURE__*/ _jsx(Button, {
|
|
73
|
+
type: "button",
|
|
74
|
+
margin: false,
|
|
75
|
+
buttonStyle: "secondary",
|
|
76
|
+
onClick: picker.open,
|
|
77
|
+
children: C.newGoal
|
|
163
78
|
}) : null
|
|
164
79
|
]
|
|
80
|
+
}),
|
|
81
|
+
readonly ? /*#__PURE__*/ _jsx(FieldError, {
|
|
82
|
+
path: path,
|
|
83
|
+
showError: showError
|
|
84
|
+
}) : null,
|
|
85
|
+
/*#__PURE__*/ _jsx(FieldDescription, {
|
|
86
|
+
path: path,
|
|
87
|
+
description: field.admin?.description
|
|
88
|
+
}),
|
|
89
|
+
!readonly && picker.status === 'error' ? /*#__PURE__*/ _jsxs("div", {
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ _jsx("p", {
|
|
92
|
+
children: C.loadError
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
95
|
+
type: "button",
|
|
96
|
+
margin: false,
|
|
97
|
+
buttonStyle: "secondary",
|
|
98
|
+
onClick: picker.retry,
|
|
99
|
+
children: C.retry
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
}) : null,
|
|
103
|
+
missing && !readonly && !showError ? /*#__PURE__*/ _jsx("p", {
|
|
104
|
+
role: "status",
|
|
105
|
+
children: C.undefinedKey
|
|
106
|
+
}) : null,
|
|
107
|
+
picker.canManage && !locked ? /*#__PURE__*/ _jsx(_Fragment, {
|
|
108
|
+
children: picker.panel.open ? /*#__PURE__*/ _jsxs("section", {
|
|
109
|
+
className: "xp-goal-field__panel",
|
|
110
|
+
"aria-labelledby": `${id}-title`,
|
|
111
|
+
children: [
|
|
112
|
+
/*#__PURE__*/ _jsx("h3", {
|
|
113
|
+
id: `${id}-title`,
|
|
114
|
+
children: C.title
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: "field-type text",
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ _jsx(FieldLabel, {
|
|
120
|
+
path: namePath,
|
|
121
|
+
label: C.name
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ _jsx("input", {
|
|
124
|
+
id: `field-${namePath}`,
|
|
125
|
+
value: picker.panel.name,
|
|
126
|
+
disabled: picker.panel.pending,
|
|
127
|
+
onKeyDown: stopEnter,
|
|
128
|
+
onChange: (event)=>picker.setName(event.currentTarget.value)
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
}),
|
|
132
|
+
/*#__PURE__*/ _jsxs("details", {
|
|
133
|
+
open: picker.panel.advanced,
|
|
134
|
+
onToggle: (event)=>picker.setAdvanced(event.currentTarget.open),
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ _jsx("summary", {
|
|
137
|
+
children: C.advanced
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
140
|
+
className: "field-type text",
|
|
141
|
+
children: [
|
|
142
|
+
/*#__PURE__*/ _jsx(FieldLabel, {
|
|
143
|
+
path: slugPath,
|
|
144
|
+
label: C.slug
|
|
145
|
+
}),
|
|
146
|
+
/*#__PURE__*/ _jsx("input", {
|
|
147
|
+
id: `field-${slugPath}`,
|
|
148
|
+
value: picker.panel.slug,
|
|
149
|
+
disabled: picker.panel.pending,
|
|
150
|
+
onKeyDown: stopEnter,
|
|
151
|
+
"aria-invalid": Boolean(picker.panel.errors.slug) || undefined,
|
|
152
|
+
"aria-describedby": picker.panel.errors.slug ? `${id}-slug-error` : undefined,
|
|
153
|
+
onChange: (event)=>picker.setSlug(event.currentTarget.value)
|
|
154
|
+
}),
|
|
155
|
+
picker.panel.errors.slug ? /*#__PURE__*/ _jsx("p", {
|
|
156
|
+
id: `${id}-slug-error`,
|
|
157
|
+
role: "alert",
|
|
158
|
+
children: picker.panel.errors.slug
|
|
159
|
+
}) : null
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}),
|
|
164
|
+
picker.panel.errors.general ? /*#__PURE__*/ _jsx("p", {
|
|
165
|
+
role: "alert",
|
|
166
|
+
children: picker.panel.errors.general
|
|
167
|
+
}) : null,
|
|
168
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
169
|
+
className: "xp-goal-field__actions",
|
|
170
|
+
children: [
|
|
171
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
172
|
+
type: "button",
|
|
173
|
+
margin: false,
|
|
174
|
+
buttonStyle: "primary",
|
|
175
|
+
disabled: picker.panel.pending || !picker.panel.name.trim(),
|
|
176
|
+
onClick: ()=>void picker.create(),
|
|
177
|
+
children: C.createGoal
|
|
178
|
+
}),
|
|
179
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
180
|
+
type: "button",
|
|
181
|
+
margin: false,
|
|
182
|
+
buttonStyle: "secondary",
|
|
183
|
+
disabled: picker.panel.pending,
|
|
184
|
+
onClick: picker.cancel,
|
|
185
|
+
children: C.cancel
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}) : null
|
|
165
191
|
}) : null
|
|
166
192
|
]
|
|
167
193
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DocId } from '../../types/contracts.js';
|
|
2
|
-
import type { SurfaceProps } from '
|
|
2
|
+
import type { SurfaceProps } from '../../testSurface/surface/contracts.js';
|
|
3
|
+
import '../../testSurface/surface/test/testPage.css';
|
|
3
4
|
export declare function ResultsRoute(props: {
|
|
4
5
|
id: DocId;
|
|
5
6
|
surface: SurfaceProps;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { useTestDocument } from '
|
|
4
|
+
import { useTestDocument } from '../../testSurface/surface/useTestDocument.js';
|
|
5
5
|
import { ResultsHeader, ReaderResultsShell } from './results/ResultsHeader.js';
|
|
6
|
-
import { ResultsBody } from '
|
|
7
|
-
import { TEST_PAGE as C } from '
|
|
6
|
+
import { ResultsBody } from '../../testSurface/surface/results/ResultsBody.js';
|
|
7
|
+
import { TEST_PAGE as C } from '../../testSurface/copy/testPage.js';
|
|
8
8
|
import { Button } from '../../ui/Button.js';
|
|
9
|
+
import '../../testSurface/surface/test/testPage.css';
|
|
9
10
|
export function ResultsRoute(props) {
|
|
10
11
|
// Results-only readers cannot load the manager-only experiment or preflight.
|
|
11
12
|
return props.surface.canManage ? /*#__PURE__*/ _jsx(ManagedResults, {
|
|
@@ -4,7 +4,7 @@ import '../theme.css';
|
|
|
4
4
|
import { formatAdminURL } from 'payload/shared';
|
|
5
5
|
import { Breadcrumb } from '../../ui/Breadcrumb.js';
|
|
6
6
|
import { Button } from '../../ui/Button.js';
|
|
7
|
-
import { SURFACE_COPY } from '
|
|
7
|
+
import { SURFACE_COPY } from '../../testSurface/copy/surface.js';
|
|
8
8
|
import './surface.css';
|
|
9
9
|
export function SurfaceShell({ adminRoute, children, crumbs = [
|
|
10
10
|
{
|
|
@@ -12,7 +12,7 @@ export function SurfaceShell({ adminRoute, children, crumbs = [
|
|
|
12
12
|
}
|
|
13
13
|
], title = SURFACE_COPY.title, status, actions, subtitle }) {
|
|
14
14
|
return /*#__PURE__*/ _jsxs("div", {
|
|
15
|
-
className: "xp-tests-surface",
|
|
15
|
+
className: "xp-tests-surface xp-test-surface",
|
|
16
16
|
children: [
|
|
17
17
|
/*#__PURE__*/ _jsxs("header", {
|
|
18
18
|
className: "xp-tests-shell-header",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SurfaceShellProps } from './SurfaceShell.js';
|
|
2
|
-
import type { ReadinessContext } from '
|
|
2
|
+
import type { ReadinessContext } from '../../testSurface/surface/readiness/readiness.model.js';
|
|
3
3
|
export declare function TestsHome({ adminRoute, apiRoute, canManage, crumbs, flagPoints }: {
|
|
4
4
|
adminRoute: string;
|
|
5
5
|
apiRoute: string;
|
|
@@ -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';
|