@delmaredigital/payload-experiments 0.1.0-rc.7 → 0.2.0-rc.2
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 +28 -0
- package/dist/admin/LayerUsage.d.ts +1 -1
- package/dist/admin/LayerUsage.js +23 -11
- package/dist/admin/MetricSourceSelect.js +2 -1
- package/dist/admin/TestsNavLink.d.ts +1 -0
- package/dist/admin/TestsNavLink.js +30 -0
- package/dist/admin/allocation.model.js +1 -1
- package/dist/admin/copy/actions.d.ts +0 -2
- package/dist/admin/copy/actions.js +0 -2
- package/dist/admin/copy/advanced.d.ts +55 -0
- package/dist/admin/copy/advanced.js +55 -0
- package/dist/admin/copy/armSelect.js +1 -1
- package/dist/admin/copy/arms.d.ts +0 -13
- package/dist/admin/copy/arms.js +0 -13
- package/dist/admin/copy/{who.d.ts → audience.d.ts} +1 -9
- package/dist/admin/copy/{who.js → audience.js} +1 -9
- package/dist/admin/copy/history.d.ts +0 -4
- package/dist/admin/copy/history.js +3 -7
- package/dist/admin/copy/metrics.d.ts +2 -2
- package/dist/admin/copy/metrics.js +2 -2
- package/dist/admin/copy/newTest.d.ts +32 -0
- package/dist/admin/copy/newTest.js +32 -0
- package/dist/admin/copy/readiness.d.ts +45 -0
- package/dist/admin/copy/readiness.js +50 -0
- package/dist/admin/copy/recommendation.d.ts +26 -0
- package/dist/admin/copy/recommendation.js +25 -0
- package/dist/admin/copy/results.d.ts +0 -1
- package/dist/admin/copy/results.js +0 -1
- package/dist/admin/copy/review.d.ts +0 -17
- package/dist/admin/copy/review.js +1 -112
- package/dist/admin/copy/setting.d.ts +10 -0
- package/dist/admin/copy/setting.js +10 -0
- package/dist/admin/copy/surface.d.ts +36 -0
- package/dist/admin/copy/surface.js +47 -0
- package/dist/admin/copy/testPage.d.ts +88 -0
- package/dist/admin/copy/testPage.js +88 -0
- package/dist/admin/paths.d.ts +5 -13
- package/dist/admin/paths.js +5 -13
- package/dist/admin/review/review.model.d.ts +3 -26
- package/dist/admin/review/review.model.js +3 -30
- package/dist/admin/surface/ResultsRoute.d.ts +7 -0
- package/dist/admin/surface/ResultsRoute.js +58 -0
- package/dist/admin/surface/SurfaceShell.d.ts +6 -0
- package/dist/admin/surface/SurfaceShell.js +35 -0
- package/dist/admin/surface/TestsHome.d.ts +4 -0
- package/dist/admin/surface/TestsHome.js +212 -0
- package/dist/admin/surface/TestsSurface.d.ts +2 -0
- package/dist/admin/surface/TestsSurface.js +36 -0
- package/dist/admin/surface/contracts.d.ts +48 -0
- package/dist/admin/surface/contracts.js +8 -0
- package/dist/admin/surface/home.model.d.ts +41 -0
- package/dist/admin/surface/home.model.js +59 -0
- package/dist/admin/surface/newTest/NewTest.d.ts +7 -0
- package/dist/admin/surface/newTest/NewTest.js +355 -0
- package/dist/admin/surface/newTest/newTest.css +9 -0
- package/dist/admin/surface/pageBlock/pageBlock.model.d.ts +6 -0
- package/dist/admin/surface/pageBlock/pageBlock.model.js +8 -0
- package/dist/admin/surface/pageBlock/parts.d.ts +2 -0
- package/dist/admin/surface/pageBlock/parts.js +64 -0
- package/dist/admin/surface/readiness/ActionDialogs.d.ts +15 -0
- package/dist/admin/surface/readiness/ActionDialogs.js +274 -0
- package/dist/admin/surface/readiness/Banner.d.ts +2 -0
- package/dist/admin/surface/readiness/Banner.js +138 -0
- package/dist/admin/surface/readiness/SaveStatus.d.ts +4 -0
- package/dist/admin/surface/readiness/SaveStatus.js +50 -0
- package/dist/admin/surface/readiness/parts.d.ts +2 -0
- package/dist/admin/surface/readiness/parts.js +9 -0
- package/dist/admin/surface/readiness/readiness.model.d.ts +22 -0
- package/dist/admin/surface/readiness/readiness.model.js +107 -0
- package/dist/admin/surface/readiness/useTransition.d.ts +10 -0
- package/dist/admin/surface/readiness/useTransition.js +34 -0
- package/dist/admin/surface/results/ResultsBody.d.ts +7 -0
- package/dist/admin/surface/results/ResultsBody.js +262 -0
- package/dist/admin/surface/results/recommendation.model.d.ts +12 -0
- package/dist/admin/surface/results/recommendation.model.js +59 -0
- package/dist/admin/surface/results/useResults.d.ts +56 -0
- package/dist/admin/surface/results/useResults.js +183 -0
- package/dist/admin/surface/setting/parts.d.ts +3 -0
- package/dist/admin/surface/setting/parts.js +263 -0
- package/dist/admin/surface/setting/setting.css +29 -0
- package/dist/admin/surface/setting/setting.model.d.ts +8 -0
- package/dist/admin/surface/setting/setting.model.js +25 -0
- package/dist/admin/surface/surface.css +50 -0
- package/dist/admin/surface/test/AdvancedSection.d.ts +2 -0
- package/dist/admin/surface/test/AdvancedSection.js +153 -0
- package/dist/admin/surface/test/GoalSection.d.ts +2 -0
- package/dist/admin/surface/test/GoalSection.js +198 -0
- package/dist/admin/surface/test/LengthSection.d.ts +2 -0
- package/dist/admin/surface/test/LengthSection.js +87 -0
- package/dist/admin/surface/test/Section.d.ts +7 -0
- package/dist/admin/surface/test/Section.js +27 -0
- package/dist/admin/surface/test/TargetingSection.d.ts +2 -0
- package/dist/admin/surface/test/TargetingSection.js +164 -0
- package/dist/admin/surface/test/TestHeader.d.ts +4 -0
- package/dist/admin/surface/test/TestHeader.js +69 -0
- package/dist/admin/surface/test/TestPage.d.ts +7 -0
- package/dist/admin/surface/test/TestPage.js +84 -0
- package/dist/admin/surface/test/VersionsSection.d.ts +4 -0
- package/dist/admin/surface/test/VersionsSection.js +208 -0
- package/dist/admin/surface/test/fields.d.ts +55 -0
- package/dist/admin/surface/test/fields.js +185 -0
- package/dist/admin/surface/test/pageParts.d.ts +2 -0
- package/dist/admin/surface/test/pageParts.js +39 -0
- package/dist/admin/surface/test/testPage.css +23 -0
- package/dist/admin/surface/test/testPage.model.d.ts +17 -0
- package/dist/admin/surface/test/testPage.model.js +53 -0
- package/dist/admin/surface/testDocument.model.d.ts +39 -0
- package/dist/admin/surface/testDocument.model.js +61 -0
- package/dist/admin/surface/useTestDocument.d.ts +22 -0
- package/dist/admin/surface/useTestDocument.js +345 -0
- package/dist/admin/targeting/targeting.model.js +2 -2
- package/dist/admin/useLayerUsage.d.ts +0 -5
- package/dist/admin/useLayerUsage.js +1 -39
- package/dist/admin/views/CollectionEditRedirect.d.ts +4 -0
- package/dist/admin/views/CollectionEditRedirect.js +14 -0
- package/dist/admin/views/CollectionListRedirect.d.ts +2 -0
- package/dist/admin/views/CollectionListRedirect.js +8 -0
- package/dist/admin/views/ExperimentsRootView.d.ts +2 -0
- package/dist/admin/views/ExperimentsRootView.js +175 -0
- package/dist/admin/views/access.model.d.ts +7 -0
- package/dist/admin/views/access.model.js +5 -0
- package/dist/collections/experiments/config.js +18 -125
- package/dist/collections/experiments/createDefaults.js +6 -0
- package/dist/collections/layers.js +43 -12
- package/dist/collections/metrics.js +70 -14
- package/dist/collections/serialize.js +4 -1
- package/dist/db/snapshots.d.ts +2 -1
- package/dist/db/snapshots.js +2 -2
- package/dist/endpoints/results.js +7 -0
- package/dist/endpoints/summary.d.ts +1 -1
- package/dist/endpoints/summary.js +37 -1
- package/dist/exports/adminClient.d.ts +2 -13
- package/dist/exports/adminClient.js +2 -13
- package/dist/exports/adminRsc.d.ts +3 -0
- package/dist/exports/adminRsc.js +3 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/options.js +29 -0
- package/dist/plugin.js +25 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +2 -1
- package/dist/puck/editor/CreateExperimentDrawer.js +17 -57
- package/dist/puck/editor/ExperimentSlotEditor.js +6 -0
- package/dist/puck/editor/copy.d.ts +10 -9
- package/dist/puck/editor/copy.js +11 -10
- package/dist/puck/editor/createTest.d.ts +7 -0
- package/dist/puck/editor/createTest.js +50 -0
- package/dist/puck/editor/editor.model.d.ts +28 -1
- package/dist/puck/editor/editor.model.js +61 -0
- package/dist/results/analyse.js +4 -1
- package/dist/results/verdict.d.ts +1 -0
- package/dist/results/verdict.js +7 -4
- package/dist/transitions/checkStart.d.ts +1 -0
- package/dist/transitions/placements.d.ts +5 -1
- package/dist/transitions/placements.js +14 -7
- package/dist/transitions/preflightData.d.ts +7 -1
- package/dist/transitions/preflightData.js +199 -148
- package/dist/transitions/start.js +2 -2
- package/dist/types/admin.d.ts +1 -0
- package/dist/types/contracts.d.ts +17 -0
- package/dist/types/endpoints.d.ts +11 -1
- package/dist/types/snapshot.d.ts +1 -0
- package/dist/types/surface.d.ts +29 -0
- package/dist/types/surface.js +1 -0
- package/package.json +7 -1
- package/dist/access.d.ts +0 -1
- package/dist/access.js +0 -2
- package/dist/admin/AllocationField.d.ts +0 -2
- package/dist/admin/AllocationField.js +0 -80
- package/dist/admin/FlagPointSelect.d.ts +0 -2
- package/dist/admin/FlagPointSelect.js +0 -54
- package/dist/admin/LockedFieldNotice.d.ts +0 -2
- package/dist/admin/LockedFieldNotice.js +0 -26
- package/dist/admin/PhaseHistory.d.ts +0 -2
- package/dist/admin/PhaseHistory.js +0 -76
- package/dist/admin/StatusCell.d.ts +0 -3
- package/dist/admin/StatusCell.js +0 -19
- package/dist/admin/SummaryCell.d.ts +0 -2
- package/dist/admin/SummaryCell.js +0 -32
- package/dist/admin/actions/AddMetricDialog.d.ts +0 -6
- package/dist/admin/actions/AddMetricDialog.js +0 -138
- package/dist/admin/actions/AllocateDialog.d.ts +0 -6
- package/dist/admin/actions/AllocateDialog.js +0 -81
- package/dist/admin/actions/ExperimentActions.d.ts +0 -3
- package/dist/admin/actions/ExperimentActions.js +0 -110
- package/dist/admin/arms/ArmsField.d.ts +0 -2
- package/dist/admin/arms/ArmsField.js +0 -310
- package/dist/admin/arms/ParamsEditor.d.ts +0 -16
- package/dist/admin/arms/ParamsEditor.js +0 -79
- package/dist/admin/copy/tabs.d.ts +0 -7
- package/dist/admin/copy/tabs.js +0 -7
- package/dist/admin/permissions.model.d.ts +0 -10
- package/dist/admin/permissions.model.js +0 -4
- package/dist/admin/phaseHistory.model.d.ts +0 -19
- package/dist/admin/phaseHistory.model.js +0 -19
- package/dist/admin/results/ResultsView.d.ts +0 -3
- package/dist/admin/results/ResultsView.js +0 -312
- package/dist/admin/review/ReviewPanel.d.ts +0 -2
- package/dist/admin/review/ReviewPanel.js +0 -268
- package/dist/admin/summaryBatcher.d.ts +0 -8
- package/dist/admin/summaryBatcher.js +0 -33
- package/dist/admin/targeting/TargetingAttributeField.d.ts +0 -2
- package/dist/admin/targeting/TargetingAttributeField.js +0 -31
- package/dist/admin/targeting/TargetingOpField.d.ts +0 -2
- package/dist/admin/targeting/TargetingOpField.js +0 -45
- package/dist/admin/targeting/TargetingValueField.d.ts +0 -2
- package/dist/admin/targeting/TargetingValueField.js +0 -142
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -4
|
@@ -78,4 +78,3 @@ export const chartSummary = (metric, groups, from, to, changes = [])=>`${metric}
|
|
|
78
78
|
type: 'conjunction'
|
|
79
79
|
}).format(changes)}.` : ''}`;
|
|
80
80
|
export const contentChangeTitle = (date)=>`Content changed ${date} by an editor`;
|
|
81
|
-
export const summaryLine = (exposures, days, verdict)=>`${exposures} ${exposures === '1' ? 'exposure' : 'exposures'} · ${days} ${days === '1' ? 'day' : 'days'} · ${verdict}`;
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import type { RefusalCode } from '../../types/endpoints.js';
|
|
2
|
-
export declare const REVIEW_HINTS: Record<RefusalCode, string>;
|
|
3
|
-
export declare const REVIEW_DONE: Record<RefusalCode, string>;
|
|
4
1
|
export declare const REVIEW_COPY: {
|
|
5
|
-
readonly save: "Save the experiment to review it.";
|
|
6
|
-
readonly loading: "Reviewing the saved experiment…";
|
|
7
|
-
readonly saveFirst: "Save your changes first; Start uses the saved experiment.";
|
|
8
2
|
readonly noBaseline: "No data yet for this metric.";
|
|
9
|
-
readonly unknownTraffic: "Traffic unknown until the test starts.";
|
|
10
|
-
readonly noEstimate: "We can't estimate the duration yet: enter how many people reach this per day.";
|
|
11
|
-
readonly infeasible: "A clear answer would take more than 90 days at this traffic.";
|
|
12
|
-
readonly apply: "Apply";
|
|
13
|
-
readonly start: "Start";
|
|
14
|
-
readonly retry: "Retry";
|
|
15
|
-
readonly duration: "Planned duration (days)";
|
|
16
|
-
readonly tuning: "Sensitivity setting (prefilled; leave as is unless a developer says otherwise)";
|
|
17
3
|
readonly preview: "Preview";
|
|
18
4
|
readonly noPreview: "Preview isn't set up for this page type";
|
|
19
5
|
readonly raise: "Raise allocation";
|
|
20
|
-
readonly allocation: "Allocation (%)";
|
|
21
6
|
readonly addMetric: "Add a metric";
|
|
22
7
|
readonly allocationBody: "Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.";
|
|
23
8
|
readonly allocationInvalid: "Enter a whole percentage higher than the current allocation and no more than 100.";
|
|
@@ -28,6 +13,4 @@ export declare const REVIEW_COPY: {
|
|
|
28
13
|
readonly chooseMetric: "Choose a metric";
|
|
29
14
|
readonly loadingMetrics: "Loading metrics…";
|
|
30
15
|
readonly noMetrics: "All available metrics are already on this experiment.";
|
|
31
|
-
readonly checkFallback: "Review this setting before starting.";
|
|
32
|
-
readonly checkDoneFallback: "Ready";
|
|
33
16
|
};
|
|
@@ -1,117 +1,8 @@
|
|
|
1
|
-
// Cover the whole union so newly added start checks cannot ship without editor copy.
|
|
2
|
-
export const REVIEW_HINTS = {
|
|
3
|
-
'recompute-failed': "Results couldn't be refreshed right now. Try Recompute again in a minute.",
|
|
4
|
-
'weights-total': 'Set the group percentages to total 100.',
|
|
5
|
-
'control-count': 'Keep exactly one Original group.',
|
|
6
|
-
'control-first': 'Put the Original first.',
|
|
7
|
-
'holdout-last': 'Put the holdout last.',
|
|
8
|
-
'holdout-count': 'Keep at most one holdout.',
|
|
9
|
-
'variant-count': 'Add between one and three variants.',
|
|
10
|
-
'duplicate-key': 'Give each group a different standard name.',
|
|
11
|
-
'duplicate-slot': 'Give each group its own content slot.',
|
|
12
|
-
'slot-required': 'Add content slots for the Original and each variant.',
|
|
13
|
-
'invalid-key': 'Use the standard group names: Original, Variant A–C, Holdout.',
|
|
14
|
-
'not-found': 'Save the experiment before reviewing it.',
|
|
15
|
-
'no-planned-duration': 'Apply the suggested duration or enter a planned duration in Metrics.',
|
|
16
|
-
'no-primary-metric': 'Choose the main metric in Metrics.',
|
|
17
|
-
'no-placements': 'Add this experiment to a page.',
|
|
18
|
-
'empty-slot': 'Add content for the Original and each variant on every page.',
|
|
19
|
-
'page-no-targets': 'Enter a page path for the Original and each variant in Groups.',
|
|
20
|
-
'page-user-unit': 'Choose visitors in Who for a whole-page experiment.',
|
|
21
|
-
'flag-no-point': 'Choose a setting in What.',
|
|
22
|
-
'flag-params-invalid': 'Check each group’s settings in Groups.',
|
|
23
|
-
'flag-point-busy': 'Stop the other experiment using this setting first.',
|
|
24
|
-
'flag-placement-missing': 'Set up content for every group where this setting is used.',
|
|
25
|
-
'layer-full': 'Free space in the layer or lower allocation before starting.',
|
|
26
|
-
'layer-unit-mismatch': 'Choose a layer that measures the same people as this experiment.',
|
|
27
|
-
'unit-source-mismatch': 'Choose a metric that measures the people selected in Who.',
|
|
28
|
-
'unknown-metric-source': 'A metric’s data source is no longer available. Choose another metric or ask a developer to restore the source.',
|
|
29
|
-
'no-reach-per-day': 'Enter how many people reach this per day in Metrics.',
|
|
30
|
-
'invalid-status': 'Only a draft or stopped experiment can start.',
|
|
31
|
-
'stale-draft': 'Reload to review the latest saved experiment.',
|
|
32
|
-
'commit-unverified': 'Reload to check whether the change was saved.',
|
|
33
|
-
'allocation-lower': 'Choose a higher percentage. Lowering needs a new round.',
|
|
34
|
-
'confirmation-required': 'Review and confirm this change.',
|
|
35
|
-
'invalid-winner': 'Choose the Original or a variant.',
|
|
36
|
-
'slices-taken': 'Free the space this experiment needs in its layer.',
|
|
37
|
-
'locked-placement': 'Finish editing every page using this experiment, then try again.',
|
|
38
|
-
'not-implemented': 'This review is not available yet.',
|
|
39
|
-
forbidden: 'Ask an admin for permission to manage experiments.',
|
|
40
|
-
unauthenticated: 'Sign in again to continue.',
|
|
41
|
-
'body-too-large': 'Reduce the size of this change and try again.',
|
|
42
|
-
'too-many-ids': 'Too many experiments were requested at once. Reload the list; if it keeps happening, contact a developer.',
|
|
43
|
-
'invalid-phase': "That round doesn't exist for this experiment. Choose another round.",
|
|
44
|
-
'invalid-ids': "The list asked for experiments it couldn't read. Reload the list.",
|
|
45
|
-
'invalid-body': 'Check the values and try again.',
|
|
46
|
-
'undeclared-targeting-key': "A rule in Who uses an attribute this site doesn't provide. Remove the rule, or ask a developer to add the attribute.",
|
|
47
|
-
'invalid-targeting-rule': "A rule in Who doesn't fit its attribute (for example, text where a number is needed). Fix the rule in Who.",
|
|
48
|
-
'duplicate-metric': 'The same metric is listed more than once. Remove the duplicate in Metrics.'
|
|
49
|
-
};
|
|
50
|
-
export const REVIEW_DONE = {
|
|
51
|
-
'recompute-failed': 'Results refreshed',
|
|
52
|
-
'weights-total': 'Group percentages total 100',
|
|
53
|
-
'control-count': 'One Original group chosen',
|
|
54
|
-
'control-first': 'Original comes first',
|
|
55
|
-
'holdout-last': 'Holdout comes last',
|
|
56
|
-
'holdout-count': 'Holdout count checked',
|
|
57
|
-
'variant-count': 'Variant count checked',
|
|
58
|
-
'duplicate-key': 'Group names are unique',
|
|
59
|
-
'duplicate-slot': 'Content slots are unique',
|
|
60
|
-
'slot-required': 'Content slots chosen',
|
|
61
|
-
'invalid-key': 'Standard group names used',
|
|
62
|
-
'not-found': 'Saved experiment found',
|
|
63
|
-
'no-planned-duration': 'Planned duration chosen',
|
|
64
|
-
'no-primary-metric': 'Main metric chosen',
|
|
65
|
-
'no-placements': 'Experiment added to a page',
|
|
66
|
-
'empty-slot': 'Content ready for every group',
|
|
67
|
-
'page-no-targets': 'Page paths chosen',
|
|
68
|
-
'page-user-unit': 'Visitors chosen for the whole-page experiment',
|
|
69
|
-
'flag-no-point': 'Setting chosen',
|
|
70
|
-
'flag-params-invalid': 'Group settings checked',
|
|
71
|
-
'flag-point-busy': 'Setting available',
|
|
72
|
-
'flag-placement-missing': 'Content ready wherever this setting is used',
|
|
73
|
-
'layer-full': 'Space available in the layer',
|
|
74
|
-
'layer-unit-mismatch': 'Layer measures the same people',
|
|
75
|
-
'unit-source-mismatch': 'Metric measures the selected people',
|
|
76
|
-
'unknown-metric-source': 'Metric data sources available',
|
|
77
|
-
'no-reach-per-day': 'Daily reach entered',
|
|
78
|
-
'invalid-status': 'Experiment ready to start',
|
|
79
|
-
'stale-draft': 'Latest saved experiment reviewed',
|
|
80
|
-
'commit-unverified': 'Saved change verified',
|
|
81
|
-
'allocation-lower': 'Higher percentage chosen',
|
|
82
|
-
'confirmation-required': 'Change confirmed',
|
|
83
|
-
'invalid-winner': 'Original or variant chosen',
|
|
84
|
-
'slices-taken': 'Required layer space available',
|
|
85
|
-
'locked-placement': 'Pages available for changes',
|
|
86
|
-
'not-implemented': 'Review available',
|
|
87
|
-
forbidden: 'Permission to manage experiments checked',
|
|
88
|
-
unauthenticated: 'Signed in',
|
|
89
|
-
'body-too-large': 'Change size checked',
|
|
90
|
-
'too-many-ids': 'List request size OK',
|
|
91
|
-
'invalid-phase': 'Round found',
|
|
92
|
-
'invalid-ids': 'List request valid',
|
|
93
|
-
'invalid-body': 'Values checked',
|
|
94
|
-
'undeclared-targeting-key': 'Targeting attributes recognised',
|
|
95
|
-
'invalid-targeting-rule': 'Targeting rules look right',
|
|
96
|
-
'duplicate-metric': 'No metric listed twice'
|
|
97
|
-
};
|
|
98
1
|
export const REVIEW_COPY = {
|
|
99
|
-
save: 'Save the experiment to review it.',
|
|
100
|
-
loading: 'Reviewing the saved experiment…',
|
|
101
|
-
saveFirst: 'Save your changes first; Start uses the saved experiment.',
|
|
102
2
|
noBaseline: 'No data yet for this metric.',
|
|
103
|
-
unknownTraffic: 'Traffic unknown until the test starts.',
|
|
104
|
-
noEstimate: "We can't estimate the duration yet: enter how many people reach this per day.",
|
|
105
|
-
infeasible: 'A clear answer would take more than 90 days at this traffic.',
|
|
106
|
-
apply: 'Apply',
|
|
107
|
-
start: 'Start',
|
|
108
|
-
retry: 'Retry',
|
|
109
|
-
duration: 'Planned duration (days)',
|
|
110
|
-
tuning: 'Sensitivity setting (prefilled; leave as is unless a developer says otherwise)',
|
|
111
3
|
preview: 'Preview',
|
|
112
4
|
noPreview: "Preview isn't set up for this page type",
|
|
113
5
|
raise: 'Raise allocation',
|
|
114
|
-
allocation: 'Allocation (%)',
|
|
115
6
|
addMetric: 'Add a metric',
|
|
116
7
|
allocationBody: 'Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.',
|
|
117
8
|
allocationInvalid: 'Enter a whole percentage higher than the current allocation and no more than 100.',
|
|
@@ -121,7 +12,5 @@ export const REVIEW_COPY = {
|
|
|
121
12
|
metric: 'Metric',
|
|
122
13
|
chooseMetric: 'Choose a metric',
|
|
123
14
|
loadingMetrics: 'Loading metrics…',
|
|
124
|
-
noMetrics: 'All available metrics are already on this experiment.'
|
|
125
|
-
checkFallback: 'Review this setting before starting.',
|
|
126
|
-
checkDoneFallback: 'Ready'
|
|
15
|
+
noMetrics: 'All available metrics are already on this experiment.'
|
|
127
16
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SETTING_COPY: {
|
|
2
|
+
readonly setting: "Setting";
|
|
3
|
+
readonly choose: "Choose the setting first.";
|
|
4
|
+
readonly current: "Current: {value}";
|
|
5
|
+
readonly holdout: "Sees the Original.";
|
|
6
|
+
readonly yes: "Yes";
|
|
7
|
+
readonly no: "No";
|
|
8
|
+
readonly empty: "Not set";
|
|
9
|
+
readonly invalid: "Set a value for {label}.";
|
|
10
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const SURFACE_COPY: {
|
|
2
|
+
readonly title: "Tests";
|
|
3
|
+
readonly newTest: "New test";
|
|
4
|
+
readonly goals: "Goals";
|
|
5
|
+
readonly search: "Search tests";
|
|
6
|
+
readonly backToAdmin: "Back to admin";
|
|
7
|
+
readonly limitedList: "Showing the 200 most recent tests.";
|
|
8
|
+
readonly notInstalled: "The Tests screen isn't installed yet. Run `payload generate:importmap` and reload.";
|
|
9
|
+
readonly noAccess: "You don't have access to tests.";
|
|
10
|
+
readonly loading: "Loading tests…";
|
|
11
|
+
readonly loadError: "Tests could not be loaded. Please try again.";
|
|
12
|
+
readonly summaryError: "Some test summaries could not be loaded. Please try again.";
|
|
13
|
+
readonly retry: "Try again";
|
|
14
|
+
readonly empty: "Test a change to see what works best for the people who visit your pages.";
|
|
15
|
+
readonly noMatches: "No tests match your search.";
|
|
16
|
+
readonly groups: readonly ["Needs attention", "Running", "Ready to start", "Draft", "Decided", "Archived"];
|
|
17
|
+
readonly kinds: {
|
|
18
|
+
readonly block: "Page block";
|
|
19
|
+
readonly flag: "Setting";
|
|
20
|
+
readonly code: "Setting";
|
|
21
|
+
readonly page: "Whole page";
|
|
22
|
+
};
|
|
23
|
+
readonly ready: "Ready to start";
|
|
24
|
+
readonly next: "Next: finish setting up";
|
|
25
|
+
readonly continue: "Continue setup";
|
|
26
|
+
readonly results: "View results";
|
|
27
|
+
readonly open: "Open";
|
|
28
|
+
readonly health: {
|
|
29
|
+
readonly red: "Stop and check";
|
|
30
|
+
readonly amber: "Check data";
|
|
31
|
+
readonly green: "On track";
|
|
32
|
+
};
|
|
33
|
+
readonly backToSetup: "Back to setup";
|
|
34
|
+
};
|
|
35
|
+
export declare function runningLine(days: string, planned: string, people: string): string;
|
|
36
|
+
export declare function decidedLine(date: string, winner: string): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const SURFACE_COPY = {
|
|
2
|
+
title: 'Tests',
|
|
3
|
+
newTest: 'New test',
|
|
4
|
+
goals: 'Goals',
|
|
5
|
+
search: 'Search tests',
|
|
6
|
+
backToAdmin: 'Back to admin',
|
|
7
|
+
limitedList: 'Showing the 200 most recent tests.',
|
|
8
|
+
notInstalled: "The Tests screen isn't installed yet. Run `payload generate:importmap` and reload.",
|
|
9
|
+
noAccess: "You don't have access to tests.",
|
|
10
|
+
loading: 'Loading tests…',
|
|
11
|
+
loadError: 'Tests could not be loaded. Please try again.',
|
|
12
|
+
summaryError: 'Some test summaries could not be loaded. Please try again.',
|
|
13
|
+
retry: 'Try again',
|
|
14
|
+
empty: 'Test a change to see what works best for the people who visit your pages.',
|
|
15
|
+
noMatches: 'No tests match your search.',
|
|
16
|
+
groups: [
|
|
17
|
+
'Needs attention',
|
|
18
|
+
'Running',
|
|
19
|
+
'Ready to start',
|
|
20
|
+
'Draft',
|
|
21
|
+
'Decided',
|
|
22
|
+
'Archived'
|
|
23
|
+
],
|
|
24
|
+
kinds: {
|
|
25
|
+
block: 'Page block',
|
|
26
|
+
flag: 'Setting',
|
|
27
|
+
code: 'Setting',
|
|
28
|
+
page: 'Whole page'
|
|
29
|
+
},
|
|
30
|
+
ready: 'Ready to start',
|
|
31
|
+
next: 'Next: finish setting up',
|
|
32
|
+
continue: 'Continue setup',
|
|
33
|
+
results: 'View results',
|
|
34
|
+
open: 'Open',
|
|
35
|
+
health: {
|
|
36
|
+
red: 'Stop and check',
|
|
37
|
+
amber: 'Check data',
|
|
38
|
+
green: 'On track'
|
|
39
|
+
},
|
|
40
|
+
backToSetup: 'Back to setup'
|
|
41
|
+
};
|
|
42
|
+
export function runningLine(days, planned, people) {
|
|
43
|
+
return `Running ${days} days of ${planned} · ${people} people so far`;
|
|
44
|
+
}
|
|
45
|
+
export function decidedLine(date, winner) {
|
|
46
|
+
return `Decided ${date}: ${winner}`;
|
|
47
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const TEST_PAGE: {
|
|
2
|
+
readonly loading: "Loading test…";
|
|
3
|
+
readonly forbidden: "You don't have access to this test.";
|
|
4
|
+
readonly missing: "This test no longer exists.";
|
|
5
|
+
readonly error: "Couldn't load this test.";
|
|
6
|
+
readonly retry: "Try again";
|
|
7
|
+
readonly name: "Test name";
|
|
8
|
+
readonly results: "Results";
|
|
9
|
+
readonly complete: "Complete";
|
|
10
|
+
readonly incomplete: "Incomplete";
|
|
11
|
+
readonly completeMark: "✓";
|
|
12
|
+
readonly incompleteMark: "○";
|
|
13
|
+
readonly kinds: {
|
|
14
|
+
readonly block: "Page block";
|
|
15
|
+
readonly page: "Whole page";
|
|
16
|
+
readonly flag: "Setting";
|
|
17
|
+
readonly code: "Setting";
|
|
18
|
+
};
|
|
19
|
+
readonly sections: {
|
|
20
|
+
readonly what: "What you're testing";
|
|
21
|
+
readonly versions: "Versions";
|
|
22
|
+
readonly win: "What counts as a win";
|
|
23
|
+
readonly who: "Who takes part (optional)";
|
|
24
|
+
readonly length: "How long";
|
|
25
|
+
readonly advanced: "Advanced settings · for developers";
|
|
26
|
+
};
|
|
27
|
+
readonly hypothesis: "Why are you testing this? (optional)";
|
|
28
|
+
readonly hypothesisPlaceholder: "We believe … will … because …";
|
|
29
|
+
readonly notPlaced: "Not on a page yet. Open a page, add an Experiment block and choose this test.";
|
|
30
|
+
readonly onPage: "On:";
|
|
31
|
+
readonly openPage: "Open the page";
|
|
32
|
+
readonly editedOnPage: "Versions are edited on the page.";
|
|
33
|
+
readonly editOnPage: "Edit on page";
|
|
34
|
+
readonly ready: "Content ready";
|
|
35
|
+
readonly emptySlot: "Nothing in this slot yet";
|
|
36
|
+
readonly pageBinding: "Each version is a whole page at its own address.";
|
|
37
|
+
readonly pageAddress: "Page address";
|
|
38
|
+
readonly holdoutContent: "Sees the Original";
|
|
39
|
+
readonly label: "Version label";
|
|
40
|
+
readonly weight: "Share (%)";
|
|
41
|
+
readonly balanceHelp: "Changing a share balances the other versions so the total stays at 100%.";
|
|
42
|
+
readonly addVersion: "Add a version";
|
|
43
|
+
readonly addHoldout: "Add a holdout";
|
|
44
|
+
readonly split: "Split evenly";
|
|
45
|
+
readonly remove: "Remove version";
|
|
46
|
+
readonly invalidShare: "Use a whole number from 0 to 100.";
|
|
47
|
+
readonly allocation: "How many people take part";
|
|
48
|
+
readonly traffic: "How people are split";
|
|
49
|
+
readonly goal: "Goal";
|
|
50
|
+
readonly goalHelp: "The goal decides whether a version wins. Pick the one thing you want more of.";
|
|
51
|
+
readonly guardrails: "Must not get worse (optional)";
|
|
52
|
+
readonly guardrailHelp: "If a version makes one of these worse, you'll be warned.";
|
|
53
|
+
readonly secondary: "Also keep an eye on (optional)";
|
|
54
|
+
readonly manageGoals: "Manage goals";
|
|
55
|
+
readonly searchGoals: "Search goals";
|
|
56
|
+
readonly chooseGoal: "Choose a goal";
|
|
57
|
+
readonly goalsError: "Couldn't load goals. Try again.";
|
|
58
|
+
readonly noGoal: "None selected";
|
|
59
|
+
readonly missingGoal: "A goal that no longer exists";
|
|
60
|
+
readonly goalUnavailable: "Goal details unavailable";
|
|
61
|
+
readonly everyone: "Everyone on the pages where this appears.";
|
|
62
|
+
readonly rulesSummary: "Only people matching these rules.";
|
|
63
|
+
readonly addRule: "Add a rule";
|
|
64
|
+
readonly removeRule: "Remove rule";
|
|
65
|
+
readonly attribute: "Attribute";
|
|
66
|
+
readonly comparison: "Comparison";
|
|
67
|
+
readonly value: "Value";
|
|
68
|
+
readonly yes: "Yes";
|
|
69
|
+
readonly no: "No";
|
|
70
|
+
readonly reach: "About how many people will see this per day?";
|
|
71
|
+
readonly reachHelp: "A rough number is fine. It only sets the suggested length.";
|
|
72
|
+
readonly duration: "Planned length (days)";
|
|
73
|
+
readonly noSuggestion: "Enter a daily number above to get a suggestion. 4 weeks is a safe default.";
|
|
74
|
+
readonly chooseGoalSuggestion: "Choose a goal to get a suggestion.";
|
|
75
|
+
readonly required: "(required)";
|
|
76
|
+
readonly apply: "Apply";
|
|
77
|
+
readonly infeasible: "This may need more people than are available.";
|
|
78
|
+
};
|
|
79
|
+
export declare const suggestedWeeks: (weeks: number) => string;
|
|
80
|
+
export declare const weeksHint: (days: number) => string;
|
|
81
|
+
export declare const NUMBER_COMPARISONS: {
|
|
82
|
+
readonly eq: "is";
|
|
83
|
+
readonly neq: "is not";
|
|
84
|
+
readonly gt: "is more than";
|
|
85
|
+
readonly gte: "is at least";
|
|
86
|
+
readonly lt: "is less than";
|
|
87
|
+
readonly lte: "is at most";
|
|
88
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const TEST_PAGE = {
|
|
2
|
+
loading: 'Loading test…',
|
|
3
|
+
forbidden: "You don't have access to this test.",
|
|
4
|
+
missing: 'This test no longer exists.',
|
|
5
|
+
error: "Couldn't load this test.",
|
|
6
|
+
retry: 'Try again',
|
|
7
|
+
name: 'Test name',
|
|
8
|
+
results: 'Results',
|
|
9
|
+
complete: 'Complete',
|
|
10
|
+
incomplete: 'Incomplete',
|
|
11
|
+
completeMark: '✓',
|
|
12
|
+
incompleteMark: '○',
|
|
13
|
+
kinds: {
|
|
14
|
+
block: 'Page block',
|
|
15
|
+
page: 'Whole page',
|
|
16
|
+
flag: 'Setting',
|
|
17
|
+
code: 'Setting'
|
|
18
|
+
},
|
|
19
|
+
sections: {
|
|
20
|
+
what: "What you're testing",
|
|
21
|
+
versions: 'Versions',
|
|
22
|
+
win: 'What counts as a win',
|
|
23
|
+
who: 'Who takes part (optional)',
|
|
24
|
+
length: 'How long',
|
|
25
|
+
advanced: 'Advanced settings · for developers'
|
|
26
|
+
},
|
|
27
|
+
hypothesis: 'Why are you testing this? (optional)',
|
|
28
|
+
hypothesisPlaceholder: 'We believe … will … because …',
|
|
29
|
+
notPlaced: 'Not on a page yet. Open a page, add an Experiment block and choose this test.',
|
|
30
|
+
onPage: 'On:',
|
|
31
|
+
openPage: 'Open the page',
|
|
32
|
+
editedOnPage: 'Versions are edited on the page.',
|
|
33
|
+
editOnPage: 'Edit on page',
|
|
34
|
+
ready: 'Content ready',
|
|
35
|
+
emptySlot: 'Nothing in this slot yet',
|
|
36
|
+
pageBinding: 'Each version is a whole page at its own address.',
|
|
37
|
+
pageAddress: 'Page address',
|
|
38
|
+
holdoutContent: 'Sees the Original',
|
|
39
|
+
label: 'Version label',
|
|
40
|
+
weight: 'Share (%)',
|
|
41
|
+
balanceHelp: 'Changing a share balances the other versions so the total stays at 100%.',
|
|
42
|
+
addVersion: 'Add a version',
|
|
43
|
+
addHoldout: 'Add a holdout',
|
|
44
|
+
split: 'Split evenly',
|
|
45
|
+
remove: 'Remove version',
|
|
46
|
+
invalidShare: 'Use a whole number from 0 to 100.',
|
|
47
|
+
allocation: 'How many people take part',
|
|
48
|
+
traffic: 'How people are split',
|
|
49
|
+
goal: 'Goal',
|
|
50
|
+
goalHelp: 'The goal decides whether a version wins. Pick the one thing you want more of.',
|
|
51
|
+
guardrails: 'Must not get worse (optional)',
|
|
52
|
+
guardrailHelp: "If a version makes one of these worse, you'll be warned.",
|
|
53
|
+
secondary: 'Also keep an eye on (optional)',
|
|
54
|
+
manageGoals: 'Manage goals',
|
|
55
|
+
searchGoals: 'Search goals',
|
|
56
|
+
chooseGoal: 'Choose a goal',
|
|
57
|
+
goalsError: "Couldn't load goals. Try again.",
|
|
58
|
+
noGoal: 'None selected',
|
|
59
|
+
missingGoal: 'A goal that no longer exists',
|
|
60
|
+
goalUnavailable: 'Goal details unavailable',
|
|
61
|
+
everyone: 'Everyone on the pages where this appears.',
|
|
62
|
+
rulesSummary: 'Only people matching these rules.',
|
|
63
|
+
addRule: 'Add a rule',
|
|
64
|
+
removeRule: 'Remove rule',
|
|
65
|
+
attribute: 'Attribute',
|
|
66
|
+
comparison: 'Comparison',
|
|
67
|
+
value: 'Value',
|
|
68
|
+
yes: 'Yes',
|
|
69
|
+
no: 'No',
|
|
70
|
+
reach: 'About how many people will see this per day?',
|
|
71
|
+
reachHelp: 'A rough number is fine. It only sets the suggested length.',
|
|
72
|
+
duration: 'Planned length (days)',
|
|
73
|
+
noSuggestion: 'Enter a daily number above to get a suggestion. 4 weeks is a safe default.',
|
|
74
|
+
chooseGoalSuggestion: 'Choose a goal to get a suggestion.',
|
|
75
|
+
required: '(required)',
|
|
76
|
+
apply: 'Apply',
|
|
77
|
+
infeasible: 'This may need more people than are available.'
|
|
78
|
+
};
|
|
79
|
+
export const suggestedWeeks = (weeks)=>`Suggested: about ${Math.round(weeks * 10) / 10} weeks`;
|
|
80
|
+
export const weeksHint = (days)=>`About ${Math.round(days / 7 * 10) / 10} weeks`;
|
|
81
|
+
export const NUMBER_COMPARISONS = {
|
|
82
|
+
eq: 'is',
|
|
83
|
+
neq: 'is not',
|
|
84
|
+
gt: 'is more than',
|
|
85
|
+
gte: 'is at least',
|
|
86
|
+
lt: 'is less than',
|
|
87
|
+
lte: 'is at most'
|
|
88
|
+
};
|
package/dist/admin/paths.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
export declare const XP_STATUS_CELL = "@delmaredigital/payload-experiments/admin/client#StatusCell";
|
|
2
|
-
export declare const XP_SUMMARY_CELL = "@delmaredigital/payload-experiments/admin/client#SummaryCell";
|
|
3
|
-
export declare const XP_ACTIONS = "@delmaredigital/payload-experiments/admin/client#ExperimentActions";
|
|
4
|
-
export declare const XP_LOCKED_NOTICE = "@delmaredigital/payload-experiments/admin/client#LockedFieldNotice";
|
|
5
|
-
export declare const XP_FLAG_POINT_SELECT = "@delmaredigital/payload-experiments/admin/client#FlagPointSelect";
|
|
6
|
-
export declare const XP_ARMS_FIELD = "@delmaredigital/payload-experiments/admin/client#ArmsField";
|
|
7
|
-
export declare const XP_ALLOCATION_FIELD = "@delmaredigital/payload-experiments/admin/client#AllocationField";
|
|
8
|
-
export declare const XP_TARGETING_ATTRIBUTE = "@delmaredigital/payload-experiments/admin/client#TargetingAttributeField";
|
|
9
|
-
export declare const XP_TARGETING_OP = "@delmaredigital/payload-experiments/admin/client#TargetingOpField";
|
|
10
|
-
export declare const XP_TARGETING_VALUE = "@delmaredigital/payload-experiments/admin/client#TargetingValueField";
|
|
11
1
|
export declare const XP_METRIC_SOURCE_SELECT = "@delmaredigital/payload-experiments/admin/client#MetricSourceSelect";
|
|
12
|
-
export declare const XP_REVIEW_PANEL = "@delmaredigital/payload-experiments/admin/client#ReviewPanel";
|
|
13
|
-
export declare const XP_PHASE_HISTORY = "@delmaredigital/payload-experiments/admin/client#PhaseHistory";
|
|
14
2
|
export declare const XP_LAYER_USAGE = "@delmaredigital/payload-experiments/admin/client#LayerUsage";
|
|
15
|
-
export declare const XP_RESULTS_VIEW = "@delmaredigital/payload-experiments/admin/client#ResultsView";
|
|
16
3
|
export declare const XP_ARM_SELECT = "@delmaredigital/payload-experiments/admin/client#ArmSelectField";
|
|
4
|
+
export declare const XP_TESTS_VIEW = "@delmaredigital/payload-experiments/admin/rsc#ExperimentsRootView";
|
|
5
|
+
export declare const XP_TESTS_LIST_REDIRECT = "@delmaredigital/payload-experiments/admin/rsc#CollectionListRedirect";
|
|
6
|
+
export declare const XP_TEST_EDIT_REDIRECT = "@delmaredigital/payload-experiments/admin/rsc#CollectionEditRedirect";
|
|
7
|
+
export declare const XP_TESTS_NAV_LINK = "@delmaredigital/payload-experiments/admin/client#TestsNavLink";
|
|
8
|
+
export declare const XP_TESTS_SURFACE = "@delmaredigital/payload-experiments/admin/client#TestsSurface";
|
package/dist/admin/paths.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
export const XP_STATUS_CELL = '@delmaredigital/payload-experiments/admin/client#StatusCell';
|
|
2
|
-
export const XP_SUMMARY_CELL = '@delmaredigital/payload-experiments/admin/client#SummaryCell';
|
|
3
|
-
export const XP_ACTIONS = '@delmaredigital/payload-experiments/admin/client#ExperimentActions';
|
|
4
|
-
export const XP_LOCKED_NOTICE = '@delmaredigital/payload-experiments/admin/client#LockedFieldNotice';
|
|
5
|
-
export const XP_FLAG_POINT_SELECT = '@delmaredigital/payload-experiments/admin/client#FlagPointSelect';
|
|
6
|
-
export const XP_ARMS_FIELD = '@delmaredigital/payload-experiments/admin/client#ArmsField';
|
|
7
|
-
export const XP_ALLOCATION_FIELD = '@delmaredigital/payload-experiments/admin/client#AllocationField';
|
|
8
|
-
export const XP_TARGETING_ATTRIBUTE = '@delmaredigital/payload-experiments/admin/client#TargetingAttributeField';
|
|
9
|
-
export const XP_TARGETING_OP = '@delmaredigital/payload-experiments/admin/client#TargetingOpField';
|
|
10
|
-
export const XP_TARGETING_VALUE = '@delmaredigital/payload-experiments/admin/client#TargetingValueField';
|
|
11
1
|
export const XP_METRIC_SOURCE_SELECT = '@delmaredigital/payload-experiments/admin/client#MetricSourceSelect';
|
|
12
|
-
export const XP_REVIEW_PANEL = '@delmaredigital/payload-experiments/admin/client#ReviewPanel';
|
|
13
|
-
export const XP_PHASE_HISTORY = '@delmaredigital/payload-experiments/admin/client#PhaseHistory';
|
|
14
2
|
export const XP_LAYER_USAGE = '@delmaredigital/payload-experiments/admin/client#LayerUsage';
|
|
15
|
-
export const XP_RESULTS_VIEW = '@delmaredigital/payload-experiments/admin/client#ResultsView';
|
|
16
3
|
export const XP_ARM_SELECT = '@delmaredigital/payload-experiments/admin/client#ArmSelectField';
|
|
4
|
+
export const XP_TESTS_VIEW = '@delmaredigital/payload-experiments/admin/rsc#ExperimentsRootView';
|
|
5
|
+
export const XP_TESTS_LIST_REDIRECT = '@delmaredigital/payload-experiments/admin/rsc#CollectionListRedirect';
|
|
6
|
+
export const XP_TEST_EDIT_REDIRECT = '@delmaredigital/payload-experiments/admin/rsc#CollectionEditRedirect';
|
|
7
|
+
export const XP_TESTS_NAV_LINK = '@delmaredigital/payload-experiments/admin/client#TestsNavLink';
|
|
8
|
+
export const XP_TESTS_SURFACE = '@delmaredigital/payload-experiments/admin/client#TestsSurface';
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
import type { MetricSource
|
|
1
|
+
import type { MetricSource } from '../../types/contracts.js';
|
|
2
2
|
import type { PreflightResult } from '../../types/endpoints.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** Baseline shown below the selected goal, using the source's number format. */
|
|
4
|
+
export declare function reviewView({ baseline }: PreflightResult, { primaryMetricKind }: {
|
|
5
5
|
primaryMetricKind?: MetricSource['kind'];
|
|
6
6
|
}): {
|
|
7
|
-
checks: {
|
|
8
|
-
ok: boolean;
|
|
9
|
-
done: string | undefined;
|
|
10
|
-
hint: string | undefined;
|
|
11
|
-
detail: string | undefined;
|
|
12
|
-
}[];
|
|
13
|
-
placements: {
|
|
14
|
-
previewAvailable: boolean;
|
|
15
|
-
collection: string;
|
|
16
|
-
id: import("../../types/contracts.js").DocId;
|
|
17
|
-
title: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
ok: boolean;
|
|
20
|
-
detail?: string;
|
|
21
|
-
}[];
|
|
22
7
|
baseline: string;
|
|
23
|
-
traffic: string;
|
|
24
|
-
estimate: string;
|
|
25
|
-
estimateWarning: boolean;
|
|
26
|
-
canStart: boolean;
|
|
27
|
-
applyValues: {
|
|
28
|
-
plannedDurationDays: number;
|
|
29
|
-
sequentialTuningParameter: number;
|
|
30
|
-
} | null;
|
|
31
8
|
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { REVIEW_COPY as C
|
|
2
|
-
|
|
3
|
-
maximumFractionDigits: 1
|
|
4
|
-
}).format(value);
|
|
5
|
-
export function reviewView(preflight, { status, primaryMetricKind }) {
|
|
6
|
-
const { baseline, estimate } = preflight;
|
|
7
|
-
const weeks = estimate ? Math.round(estimate.weeks * 10) / 10 : 0;
|
|
1
|
+
import { REVIEW_COPY as C } from '../copy/review.js';
|
|
2
|
+
/** Baseline shown below the selected goal, using the source's number format. */ export function reviewView({ baseline }, { primaryMetricKind }) {
|
|
8
3
|
const formatted = baseline ? new Intl.NumberFormat('en-US', primaryMetricKind === 'binomial' ? {
|
|
9
4
|
style: 'percent',
|
|
10
5
|
maximumFractionDigits: 1
|
|
@@ -13,28 +8,6 @@ export function reviewView(preflight, { status, primaryMetricKind }) {
|
|
|
13
8
|
maximumFractionDigits: primaryMetricKind === 'revenue' ? 2 : 1
|
|
14
9
|
}).format(baseline.value) : null;
|
|
15
10
|
return {
|
|
16
|
-
|
|
17
|
-
const detail = typeof check.detail === 'string' ? check.detail : check.detail && typeof check.detail === 'object' && 'message' in check.detail && typeof check.detail.message === 'string' ? check.detail.message : undefined;
|
|
18
|
-
const hint = check.ok ? undefined : REVIEW_HINTS[check.code] ?? detail ?? C.checkFallback;
|
|
19
|
-
return {
|
|
20
|
-
ok: check.ok,
|
|
21
|
-
done: check.ok ? REVIEW_DONE[check.code] ?? C.checkDoneFallback : undefined,
|
|
22
|
-
hint,
|
|
23
|
-
detail: detail === hint ? undefined : detail
|
|
24
|
-
};
|
|
25
|
-
}),
|
|
26
|
-
placements: preflight.placements.map((placement)=>({
|
|
27
|
-
...placement,
|
|
28
|
-
previewAvailable: Boolean(placement.url)
|
|
29
|
-
})),
|
|
30
|
-
baseline: formatted === null ? C.noBaseline : `Over the last 28 days: ${formatted}`,
|
|
31
|
-
traffic: preflight.trafficPerDay === null ? C.unknownTraffic : `About ${number(preflight.trafficPerDay)} people a day`,
|
|
32
|
-
estimate: !estimate ? C.noEstimate : !estimate.feasible ? C.infeasible : `≈ ${number(weeks)} weeks`,
|
|
33
|
-
estimateWarning: Boolean(estimate && (weeks > 8 || !estimate.feasible)),
|
|
34
|
-
canStart: preflight.checks.every((check)=>check.ok) && (status === 'draft' || status === 'stopped'),
|
|
35
|
-
applyValues: estimate ? {
|
|
36
|
-
plannedDurationDays: estimate.plannedDurationDays,
|
|
37
|
-
sequentialTuningParameter: estimate.sequentialTuningParameter
|
|
38
|
-
} : null
|
|
11
|
+
baseline: formatted === null ? C.noBaseline : `Over the last 28 days: ${formatted}`
|
|
39
12
|
};
|
|
40
13
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTestDocument } from './useTestDocument.js';
|
|
4
|
+
import { TestHeader } from './test/TestHeader.js';
|
|
5
|
+
import { ResultsBody } from './results/ResultsBody.js';
|
|
6
|
+
import { TEST_PAGE as C } from '../copy/testPage.js';
|
|
7
|
+
import './test/testPage.css';
|
|
8
|
+
export function ResultsRoute(props) {
|
|
9
|
+
// Results-only readers cannot load the manager-only experiment or preflight.
|
|
10
|
+
return props.surface.canManage ? /*#__PURE__*/ _jsx(ManagedResults, {
|
|
11
|
+
...props
|
|
12
|
+
}) : /*#__PURE__*/ _jsx(ResultsBody, {
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function ManagedResults({ id, surface }) {
|
|
17
|
+
const test = useTestDocument(id, {
|
|
18
|
+
apiRoute: surface.apiRoute
|
|
19
|
+
});
|
|
20
|
+
// Add-goal changes metrics while status, phase and allocation stay the same.
|
|
21
|
+
const bodyKey = test.doc ? JSON.stringify([
|
|
22
|
+
test.doc.status,
|
|
23
|
+
test.doc.phase,
|
|
24
|
+
test.doc.allocation,
|
|
25
|
+
test.doc.metrics
|
|
26
|
+
]) : 'loading';
|
|
27
|
+
// ResultsBody's Decide is the shared DecideDialog, which reloads the page; Recompute keeps status.
|
|
28
|
+
return /*#__PURE__*/ _jsxs("main", {
|
|
29
|
+
className: "xp-test-page",
|
|
30
|
+
children: [
|
|
31
|
+
test.loadState === 'ready' && test.doc ? /*#__PURE__*/ _jsx(TestHeader, {
|
|
32
|
+
test: test,
|
|
33
|
+
surface: surface,
|
|
34
|
+
view: "results"
|
|
35
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
36
|
+
role: "status",
|
|
37
|
+
children: test.loadState === 'forbidden' ? C.forbidden : test.loadState === 'missing' ? C.missing : test.loadState === 'error' ? C.error : C.loading
|
|
38
|
+
}),
|
|
39
|
+
test.loadState === 'error' ? /*#__PURE__*/ _jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
onClick: ()=>void test.reload(),
|
|
42
|
+
children: C.retry
|
|
43
|
+
}) : null,
|
|
44
|
+
test.errors._section ? /*#__PURE__*/ _jsx("p", {
|
|
45
|
+
role: "alert",
|
|
46
|
+
children: test.errors._section
|
|
47
|
+
}) : null,
|
|
48
|
+
test.preflightError ? /*#__PURE__*/ _jsx("p", {
|
|
49
|
+
role: "alert",
|
|
50
|
+
children: test.preflightError
|
|
51
|
+
}) : null,
|
|
52
|
+
test.loadState !== 'loading' && test.loadState !== 'missing' && test.loadState !== 'forbidden' ? /*#__PURE__*/ _jsx(ResultsBody, {
|
|
53
|
+
id: id,
|
|
54
|
+
surface: surface
|
|
55
|
+
}, bodyKey) : null
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|