@delmaredigital/payload-experiments 0.4.0-rc.10 → 0.4.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/MetricSourceSelect.js +10 -3
- package/dist/admin/copy/blocks.js +3 -3
- package/dist/admin/copy/goals.d.ts +15 -8
- package/dist/admin/copy/goals.js +18 -8
- package/dist/admin/copy/newTest.d.ts +3 -2
- package/dist/admin/copy/newTest.js +3 -2
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +25 -3
- package/dist/admin/surface/TestRowMenu.d.ts +7 -0
- package/dist/admin/surface/TestRowMenu.js +9 -2
- package/dist/admin/surface/TestsHome.js +8 -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 -191
- 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 +1 -0
- package/dist/admin/surface/home.model.js +5 -1
- package/dist/admin/surface/newTest/NewTest.js +56 -29
- package/dist/admin/surface/newTest/PageWizard.d.ts +3 -1
- package/dist/admin/surface/newTest/PageWizard.js +14 -14
- package/dist/admin/surface/newTest/newTest.css +3 -3
- package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +69 -41
- package/dist/admin/surface/surface.css +20 -1
- package/dist/admin/surface/test/TestPage.js +46 -34
- 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/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +1 -1
- package/dist/collections/metrics.js +12 -5
- package/dist/collections/serialize.js +3 -2
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/plugin.js +51 -1
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +96 -43
- package/dist/puck/editor/QuickTestActions.d.ts +2 -2
- package/dist/puck/editor/QuickTestActions.js +42 -27
- package/dist/puck/editor/ResultsReadout.d.ts +3 -1
- package/dist/puck/editor/ResultsReadout.js +28 -16
- package/dist/puck/editor/VersionBuilder.d.ts +2 -1
- package/dist/puck/editor/VersionBuilder.js +14 -8
- package/dist/puck/editor/copy.d.ts +3 -3
- package/dist/puck/editor/copy.js +4 -4
- package/dist/puck/editor/editor.chrome.css +9 -1
- package/dist/puck/editor/editor.css +10 -1
- package/dist/puck/nestedTestCopy.js +1 -1
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +1 -1
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- package/dist/results/verdict.d.ts +1 -1
- package/dist/results/verdict.js +7 -6
- package/dist/server/runResults.js +2 -1
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +3 -2
- package/dist/testSurface/actions/DecideDialog.js +21 -12
- package/dist/testSurface/actions/LifecycleAction.d.ts +2 -1
- package/dist/testSurface/actions/LifecycleAction.js +3 -1
- package/dist/testSurface/actions/actions.model.js +6 -5
- 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/copy/actions.d.ts +12 -9
- package/dist/testSurface/copy/actions.js +12 -9
- 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 +2 -2
- package/dist/testSurface/copy/common.js +2 -2
- package/dist/testSurface/copy/metrics.d.ts +6 -0
- package/dist/testSurface/copy/metrics.js +8 -0
- package/dist/testSurface/copy/readiness.d.ts +3 -3
- package/dist/testSurface/copy/readiness.js +5 -5
- package/dist/testSurface/copy/recommendation.d.ts +4 -4
- package/dist/testSurface/copy/recommendation.js +4 -4
- package/dist/testSurface/copy/results.d.ts +13 -9
- package/dist/testSurface/copy/results.js +15 -9
- package/dist/testSurface/copy/review.d.ts +12 -9
- package/dist/testSurface/copy/review.js +13 -9
- package/dist/testSurface/copy/setting.d.ts +1 -2
- package/dist/testSurface/copy/setting.js +1 -2
- package/dist/testSurface/copy/surface.js +1 -1
- package/dist/testSurface/copy/testPage.d.ts +13 -9
- package/dist/testSurface/copy/testPage.js +16 -13
- package/dist/testSurface/format/date.d.ts +1 -0
- package/dist/testSurface/format/date.js +11 -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/results/results.model.d.ts +3 -2
- package/dist/testSurface/results/results.model.js +10 -9
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +1 -1
- package/dist/testSurface/surface/pageBlock/parts.js +17 -7
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +0 -5
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +1 -1
- package/dist/testSurface/surface/readiness/ActionDialogs.js +54 -33
- package/dist/testSurface/surface/readiness/Banner.d.ts +3 -1
- package/dist/testSurface/surface/readiness/Banner.js +86 -75
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +5 -2
- package/dist/testSurface/surface/readiness/SaveStatus.js +8 -7
- package/dist/testSurface/surface/readiness/readiness.model.js +1 -1
- package/dist/testSurface/surface/results/ResultsBody.d.ts +4 -1
- package/dist/testSurface/surface/results/ResultsBody.js +119 -80
- package/dist/testSurface/surface/results/recommendation.model.js +3 -3
- package/dist/testSurface/surface/setting/parts.js +31 -28
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +10 -4
- package/dist/testSurface/surface/test/GoalSection.js +11 -11
- package/dist/testSurface/surface/test/LengthSection.js +20 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +7 -7
- package/dist/testSurface/surface/test/ReadinessBar.d.ts +1 -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 +7 -2
- package/dist/testSurface/surface/test/VersionsSection.js +88 -68
- package/dist/testSurface/surface/test/fields.d.ts +4 -3
- package/dist/testSurface/surface/test/fields.js +10 -16
- package/dist/testSurface/surface/test/pageParts.js +3 -1
- package/dist/testSurface/surface/test/testPage.css +9 -1
- package/dist/testSurface/surfaceUrls.d.ts +1 -0
- package/dist/testSurface/surfaceUrls.js +4 -0
- package/dist/ui/Dialog.js +25 -0
- package/dist/ui/Inputs.js +0 -1
- package/dist/ui/ui.css +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export const GOAL_ROLES = {
|
|
2
|
+
primary: 'Main goal',
|
|
3
|
+
secondary: 'Also tracked',
|
|
4
|
+
guardrail: 'Must not get worse'
|
|
5
|
+
};
|
|
1
6
|
export const METRICS_COPY = {
|
|
2
7
|
source: 'Measured by',
|
|
3
8
|
browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
|
|
@@ -8,3 +13,6 @@ export const METRIC_KIND_LABELS = {
|
|
|
8
13
|
count: 'count',
|
|
9
14
|
revenue: 'amount'
|
|
10
15
|
};
|
|
16
|
+
export function percentileTail(quantile) {
|
|
17
|
+
return Number(((1 - quantile) * 100).toPrecision(12));
|
|
18
|
+
}
|
|
@@ -36,11 +36,11 @@ export declare const READINESS_COPY: {
|
|
|
36
36
|
readonly running: "Running";
|
|
37
37
|
readonly stopped: "Stopped";
|
|
38
38
|
readonly decided: "Decided";
|
|
39
|
-
readonly addMetric: "Add a
|
|
39
|
+
readonly addMetric: "Add a goal to track alongside the main goal.";
|
|
40
40
|
readonly allocate: "Let more people in";
|
|
41
41
|
readonly everyone: "Everyone already takes part.";
|
|
42
42
|
readonly participation: "How many people take part (%)";
|
|
43
|
-
readonly noPlacements: "This test needs a block on a page. Add it to
|
|
43
|
+
readonly noPlacements: "This test needs a block on a page. Add it to a Test block.";
|
|
44
44
|
readonly placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.";
|
|
45
45
|
readonly noPoint: "Choose the setting to test.";
|
|
46
46
|
readonly busy: "Another test is already running on this setting. Stop it first.";
|
|
@@ -100,7 +100,7 @@ export declare const pageGuardCopy: (name: string, status: "running" | "decided"
|
|
|
100
100
|
export declare const versionPageUnavailableCopy: (path: string, status?: string) => string;
|
|
101
101
|
export declare const versionPageUncheckedCopy: (path: string, status?: string) => string;
|
|
102
102
|
export declare const sameAddressCopy: (label: string, other: string, path: string) => string;
|
|
103
|
-
export declare const identicalVersionCopy: (version: string) => string;
|
|
103
|
+
export declare const identicalVersionCopy: (version: string, control: string) => string;
|
|
104
104
|
/** Keep named actions aligned with the actual transition buttons. */
|
|
105
105
|
export declare function placementGuardCopy(page: {
|
|
106
106
|
name: string;
|
|
@@ -36,11 +36,11 @@ export const READINESS_COPY = {
|
|
|
36
36
|
running: 'Running',
|
|
37
37
|
stopped: 'Stopped',
|
|
38
38
|
decided: 'Decided',
|
|
39
|
-
addMetric: 'Add a
|
|
39
|
+
addMetric: 'Add a goal to track alongside the main goal.',
|
|
40
40
|
allocate: 'Let more people in',
|
|
41
41
|
everyone: 'Everyone already takes part.',
|
|
42
42
|
participation: 'How many people take part (%)',
|
|
43
|
-
noPlacements: 'This test needs a block on a page. Add it to
|
|
43
|
+
noPlacements: 'This test needs a block on a page. Add it to a Test block.',
|
|
44
44
|
placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.",
|
|
45
45
|
noPoint: 'Choose the setting to test.',
|
|
46
46
|
busy: 'Another test is already running on this setting. Stop it first.',
|
|
@@ -77,7 +77,7 @@ export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)
|
|
|
77
77
|
export const contentNext = (group, page = 'the page')=>`Add content for ${group} on ${page}.`;
|
|
78
78
|
export const draftContentNext = (group, page)=>`${group} has content in the draft of ${page}. ${READINESS_COPY.publishPage}.`;
|
|
79
79
|
export const unsavedContentNext = (group)=>`${group} has unsaved content. ${READINESS_COPY.saveAndPublishPage}.`;
|
|
80
|
-
export const partialContentNext = (group, page)=>`Fill ${group} in the empty
|
|
80
|
+
export const partialContentNext = (group, page)=>`Fill ${group} in the empty Test blocks on ${page}.`;
|
|
81
81
|
export function summaryContentNext(groups, draftGroups = []) {
|
|
82
82
|
const format = new Intl.ListFormat('en-US');
|
|
83
83
|
return [
|
|
@@ -106,7 +106,7 @@ export const pendingBlockRemovalCopy = (name)=>`“${name}” is running and the
|
|
|
106
106
|
export const versionPageUnavailableCopy = (path, status = 'running')=>`${path} isn't published, so visitors assigned to it see an error. Republish it, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
|
|
107
107
|
export const versionPageUncheckedCopy = (path, status = 'running')=>`Couldn't check whether ${path} is published. Check that it is still published, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
|
|
108
108
|
export const sameAddressCopy = (label, other, path)=>`${label} has the same address (${path}) as ${other}. Choose a different page.`;
|
|
109
|
-
export const identicalVersionCopy = (version)=>`${version} looks the same as
|
|
109
|
+
export const identicalVersionCopy = (version, control)=>`${version} looks the same as ${control}, so the test would compare nothing. Change it before you start.`;
|
|
110
110
|
/** Keep named actions aligned with the actual transition buttons. */ export function placementGuardCopy(page, block, preExisting) {
|
|
111
111
|
const action = (test)=>test.status === 'running' ? `stop ${test.name}` : `choose "Make it the content" or "Discard winner" on ${test.name}`;
|
|
112
112
|
return preExisting ? `This page is in two tests that change it, ${page.name} and ${block.name}. Before you publish, ${action(page)} or ${action(block)}.` : `This page is part of the ${page.status} test ${page.name}, so a block from another test can't be added to it. Finish one of the tests first.`;
|
|
@@ -133,4 +133,4 @@ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && det
|
|
|
133
133
|
}).join('\n');
|
|
134
134
|
export const unpublishedPlacementCopy = (title = 'this page')=>`The block you're testing is only on a draft of ${title}. Publish the page before you start.`;
|
|
135
135
|
export const finishEditCopy = (field)=>`Finish your edit to “${field}” before starting the test.`;
|
|
136
|
-
export const duplicateVersionCopy = (page)=>`The
|
|
136
|
+
export const duplicateVersionCopy = (page)=>`The Test block on ${page} has the same version twice. Remove the extra version.`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const RECOMMENDATION_COPY: {
|
|
2
|
-
readonly unavailable: "Results aren't available right now.
|
|
2
|
+
readonly unavailable: "Results aren't available right now. Refresh results, and ask a developer if it keeps happening.";
|
|
3
3
|
readonly dataProblem: "Stop: the data looks unbalanced, check the setup.";
|
|
4
4
|
readonly collecting: "Too early to tell. Keep it running.";
|
|
5
5
|
readonly stoppedCollecting: "Stopped before enough people took part to tell.";
|
|
6
|
-
readonly originalBetter:
|
|
7
|
-
readonly noDifference:
|
|
6
|
+
readonly originalBetter: (control: string) => string;
|
|
7
|
+
readonly noDifference: (control: string) => string;
|
|
8
8
|
readonly keepRunning: "No difference so far. Keep running.";
|
|
9
9
|
readonly longDuration: "No clear difference, and a clear answer would take more than 3 months at this traffic. Consider a bigger change.";
|
|
10
10
|
readonly group: "Variant";
|
|
@@ -13,7 +13,7 @@ export declare const RECOMMENDATION_COPY: {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const guardrailRecommendation: (group: string, guardrail: string) => string;
|
|
15
15
|
export declare const collectingRecommendation: (people: string) => string;
|
|
16
|
-
export declare const worseRecommendation: (group: string) => string;
|
|
16
|
+
export declare const worseRecommendation: (group: string, control: string) => string;
|
|
17
17
|
export declare const winnerRecommendation: (group: string) => string;
|
|
18
18
|
export declare const mixedRecommendation: (better: string, worse: string) => string;
|
|
19
19
|
export declare const runningRecommendation: (date: string) => string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const RECOMMENDATION_COPY = {
|
|
2
|
-
unavailable: "Results aren't available right now.
|
|
2
|
+
unavailable: "Results aren't available right now. Refresh results, and ask a developer if it keeps happening.",
|
|
3
3
|
dataProblem: 'Stop: the data looks unbalanced, check the setup.',
|
|
4
4
|
collecting: 'Too early to tell. Keep it running.',
|
|
5
5
|
stoppedCollecting: 'Stopped before enough people took part to tell.',
|
|
6
|
-
originalBetter:
|
|
7
|
-
noDifference:
|
|
6
|
+
originalBetter: (control)=>`${control} is best. Keep ${control}.`,
|
|
7
|
+
noDifference: (control)=>`No difference found. Keep ${control}, or test a bigger change.`,
|
|
8
8
|
keepRunning: 'No difference so far. Keep running.',
|
|
9
9
|
longDuration: 'No clear difference, and a clear answer would take more than 3 months at this traffic. Consider a bigger change.',
|
|
10
10
|
group: 'Variant',
|
|
@@ -13,7 +13,7 @@ export const RECOMMENDATION_COPY = {
|
|
|
13
13
|
};
|
|
14
14
|
export const guardrailRecommendation = (group, guardrail)=>`Stop: ${group} is making ${guardrail} worse.`;
|
|
15
15
|
export const collectingRecommendation = (people)=>`Too early to tell. About ${people} more people needed to be sure.`;
|
|
16
|
-
export const worseRecommendation = (group)=>`No version beats
|
|
16
|
+
export const worseRecommendation = (group, control)=>`No version beats ${control}, and ${group} does worse. Keep ${control}.`;
|
|
17
17
|
export const winnerRecommendation = (group)=>`${group} is most likely to be best.`;
|
|
18
18
|
export const mixedRecommendation = (better, worse)=>`Mixed: ${better} does better, ${worse} does worse. Review before deciding.`;
|
|
19
19
|
export const runningRecommendation = (date)=>`No difference so far. Keep running until ${date}.`;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const RESULTS_COPY: {
|
|
2
|
-
readonly chooseGroup: "Choose a group";
|
|
3
2
|
readonly tests: "Tests";
|
|
4
3
|
readonly results: "Results";
|
|
5
4
|
readonly test: "Test";
|
|
@@ -39,7 +38,6 @@ export declare const RESULTS_COPY: {
|
|
|
39
38
|
readonly chanceToWin: "Chance to win";
|
|
40
39
|
readonly risk: "Risk";
|
|
41
40
|
readonly comparison: "Comparison";
|
|
42
|
-
readonly original: "Original";
|
|
43
41
|
readonly holdout: "Measured, not compared";
|
|
44
42
|
readonly holdoutBaseline: "Holdout · baseline";
|
|
45
43
|
readonly shippedGroup: "the winner";
|
|
@@ -59,7 +57,7 @@ export declare const RESULTS_COPY: {
|
|
|
59
57
|
readonly noCap: "Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.";
|
|
60
58
|
readonly quality: "Data quality";
|
|
61
59
|
readonly missingWinner: "The stored winner is missing from this round's results.";
|
|
62
|
-
readonly missingWinnerNext: "
|
|
60
|
+
readonly missingWinnerNext: "Refresh results. If the problem continues, contact a developer before trusting these results.";
|
|
63
61
|
readonly srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.";
|
|
64
62
|
readonly srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.";
|
|
65
63
|
readonly multiGroup: "People who saw more than one group were excluded.";
|
|
@@ -84,7 +82,7 @@ export declare const RESULTS_COPY: {
|
|
|
84
82
|
'not-supplied': string;
|
|
85
83
|
'analysis-failed': string;
|
|
86
84
|
};
|
|
87
|
-
readonly unavailableNext: "
|
|
85
|
+
readonly unavailableNext: "Refresh results. If the problem continues, contact a developer.";
|
|
88
86
|
readonly loading: "Loading results…";
|
|
89
87
|
readonly refreshing: "Refreshing…";
|
|
90
88
|
readonly retryPreview: "Retry preview links";
|
|
@@ -92,11 +90,13 @@ export declare const RESULTS_COPY: {
|
|
|
92
90
|
readonly empty: "No results yet — the first results appear within the hour after Start.";
|
|
93
91
|
readonly retry: "Retry";
|
|
94
92
|
readonly round: "Round";
|
|
95
|
-
readonly recompute: "
|
|
96
|
-
readonly recomputing: "
|
|
97
|
-
readonly
|
|
98
|
-
readonly
|
|
99
|
-
readonly
|
|
93
|
+
readonly recompute: "Refresh results";
|
|
94
|
+
readonly recomputing: "Refreshing…";
|
|
95
|
+
readonly updated: (time: string) => string;
|
|
96
|
+
readonly previousRound: "Choose the latest test round to decide.";
|
|
97
|
+
readonly primary: "Main goal";
|
|
98
|
+
readonly secondary: "Also tracked (not used for the decision)";
|
|
99
|
+
readonly guardrail: "Must not get worse";
|
|
100
100
|
readonly chart: "Confidence interval over time";
|
|
101
101
|
readonly noHistory: "Not enough history yet.";
|
|
102
102
|
};
|
|
@@ -108,6 +108,8 @@ export declare const moreDays: (days: string) => string;
|
|
|
108
108
|
export declare const collectingCopy: (n: string, minimum: string, conversions: string, conversionMinimum: string) => string;
|
|
109
109
|
export declare const uncappedTotal: (total: string) => string;
|
|
110
110
|
export declare const cappedCount: (count: string, cap: string) => string;
|
|
111
|
+
export declare const revenueCapHelp: (threshold: string) => string;
|
|
112
|
+
export declare const percentileCapHelp: (tail: number) => string;
|
|
111
113
|
export declare const atLeast: (bound: string) => string;
|
|
112
114
|
export declare const atMost: (bound: string) => string;
|
|
113
115
|
export declare const intervalCopy: (low: string, high: string) => string;
|
|
@@ -120,3 +122,5 @@ export declare const metricUnavailable: (name: string, reason: string) => string
|
|
|
120
122
|
export declare const chartSummary: (metric: string, groups: string, from: string, to: string, changes?: string[]) => string;
|
|
121
123
|
export declare const contentChangeTitle: (date: string) => string;
|
|
122
124
|
export declare const daysOfPlan: (days: string, planned: string) => string;
|
|
125
|
+
/** Use the frozen control label in the fixed wording stored by older verdict writers. */
|
|
126
|
+
export declare function verdictControlCopy(sentence: string, control: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
1
2
|
export const RESULTS_COPY = {
|
|
2
|
-
chooseGroup: 'Choose a group',
|
|
3
3
|
tests: 'Tests',
|
|
4
4
|
results: 'Results',
|
|
5
5
|
test: 'Test',
|
|
@@ -39,7 +39,6 @@ export const RESULTS_COPY = {
|
|
|
39
39
|
chanceToWin: 'Chance to win',
|
|
40
40
|
risk: 'Risk',
|
|
41
41
|
comparison: 'Comparison',
|
|
42
|
-
original: 'Original',
|
|
43
42
|
holdout: 'Measured, not compared',
|
|
44
43
|
holdoutBaseline: 'Holdout · baseline',
|
|
45
44
|
shippedGroup: 'the winner',
|
|
@@ -59,7 +58,7 @@ export const RESULTS_COPY = {
|
|
|
59
58
|
noCap: 'Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.',
|
|
60
59
|
quality: 'Data quality',
|
|
61
60
|
missingWinner: "The stored winner is missing from this round's results.",
|
|
62
|
-
missingWinnerNext: '
|
|
61
|
+
missingWinnerNext: 'Refresh results. If the problem continues, contact a developer before trusting these results.',
|
|
63
62
|
srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.",
|
|
64
63
|
srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.",
|
|
65
64
|
multiGroup: 'People who saw more than one group were excluded.',
|
|
@@ -84,7 +83,7 @@ export const RESULTS_COPY = {
|
|
|
84
83
|
'not-supplied': "has no data for this results run; the next results run will try again.",
|
|
85
84
|
'analysis-failed': "couldn't be calculated this time; the next results run will try again."
|
|
86
85
|
},
|
|
87
|
-
unavailableNext: '
|
|
86
|
+
unavailableNext: 'Refresh results. If the problem continues, contact a developer.',
|
|
88
87
|
loading: 'Loading results…',
|
|
89
88
|
refreshing: 'Refreshing…',
|
|
90
89
|
retryPreview: 'Retry preview links',
|
|
@@ -92,11 +91,13 @@ export const RESULTS_COPY = {
|
|
|
92
91
|
empty: 'No results yet — the first results appear within the hour after Start.',
|
|
93
92
|
retry: 'Retry',
|
|
94
93
|
round: 'Round',
|
|
95
|
-
recompute: '
|
|
96
|
-
recomputing: '
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
recompute: 'Refresh results',
|
|
95
|
+
recomputing: 'Refreshing…',
|
|
96
|
+
updated: (time)=>`Updated ${time}`,
|
|
97
|
+
previousRound: 'Choose the latest test round to decide.',
|
|
98
|
+
primary: GOAL_ROLES.primary,
|
|
99
|
+
secondary: `${GOAL_ROLES.secondary} (not used for the decision)`,
|
|
100
|
+
guardrail: GOAL_ROLES.guardrail,
|
|
100
101
|
chart: 'Confidence interval over time',
|
|
101
102
|
noHistory: 'Not enough history yet.'
|
|
102
103
|
};
|
|
@@ -108,6 +109,8 @@ export const moreDays = (days)=>`About ${days} more ${days === '1' ? 'day' : 'da
|
|
|
108
109
|
export const collectingCopy = (n, minimum, conversions, conversionMinimum)=>`${n} of ${minimum} people, ${conversions} of ${conversionMinimum} conversions`;
|
|
109
110
|
export const uncappedTotal = (total)=>`Total ${total} (not capped)`;
|
|
110
111
|
export const cappedCount = (count, cap)=>`${count} capped at ${cap}`;
|
|
112
|
+
export const revenueCapHelp = (threshold)=>`Amounts above ${threshold} are limited in the comparison. Totals include the full amounts.`;
|
|
113
|
+
export const percentileCapHelp = (tail)=>revenueCapHelp(tail === 0 ? 'the largest amount from the 90 days before the test' : `the cutoff for the largest ${tail}% of amounts from the 90 days before the test`);
|
|
111
114
|
export const atLeast = (bound)=>`at least ${bound}`;
|
|
112
115
|
export const atMost = (bound)=>`at most ${bound}`;
|
|
113
116
|
export const intervalCopy = (low, high)=>`${low} to ${high}`;
|
|
@@ -123,3 +126,6 @@ export const chartSummary = (metric, groups, from, to, changes = [])=>`${metric}
|
|
|
123
126
|
}).format(changes)}.` : ''}`;
|
|
124
127
|
export const contentChangeTitle = (date)=>`Content changed ${date} by an editor`;
|
|
125
128
|
export const daysOfPlan = (days, planned)=>`${days} of ${planned}`;
|
|
129
|
+
/** Use the frozen control label in the fixed wording stored by older verdict writers. */ export function verdictControlCopy(sentence, control) {
|
|
130
|
+
return sentence.replace(/^The Original is better\.(?= Decide for the Original\.$|$)/, ()=>`${control} is better.`).replace(/(^|\. )Decide for the Original(?=\.$| or restart without (?:it|them)\.$)/, (_, boundary)=>`${boundary}Decide for ${control}`).replace(/^((?:Both|All \d+ variants) beat )the Original;/, (_, lead)=>`${lead}${control};`).replace(/^(The main outcome improved compared with |This describes the shipped version compared with people still seeing )the Original\.$/, (_, lead)=>`${lead}${control}.`).replace(/(^|\. )((?:Smallest group so far|Fewest conversions so far): )Original,/g, (_, boundary, lead)=>`${boundary}${lead}${control},`);
|
|
131
|
+
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
export declare const REVIEW_COPY: {
|
|
2
|
-
readonly noBaseline: "No data yet for this
|
|
2
|
+
readonly noBaseline: "No data yet for this goal.";
|
|
3
3
|
readonly preview: "Preview";
|
|
4
4
|
readonly previewBlocked: "Your browser blocked the preview window. Allow pop-ups for this site.";
|
|
5
5
|
readonly placedTimes: (n: number) => string;
|
|
6
6
|
readonly raise: "Raise allocation";
|
|
7
|
-
readonly addMetric: "Add a
|
|
7
|
+
readonly addMetric: "Add a goal";
|
|
8
8
|
readonly allocationBody: "Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.";
|
|
9
9
|
readonly allocationInvalid: "Enter a whole percentage higher than the current allocation and no more than 100.";
|
|
10
|
-
readonly role: "
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
10
|
+
readonly role: "How it counts";
|
|
11
|
+
readonly primary: "Main goal";
|
|
12
|
+
readonly supporting: "Also tracked";
|
|
13
|
+
readonly guardrail: "Must not get worse";
|
|
14
|
+
readonly metric: "Goal";
|
|
15
|
+
readonly chooseMetric: "Choose a goal";
|
|
16
|
+
readonly loadingMetrics: "Loading goals…";
|
|
17
|
+
readonly createGoal: "Create a goal";
|
|
18
|
+
readonly noMetrics: "There are no goals yet.";
|
|
19
|
+
readonly allMetricsAttached: "Every goal is already on this test.";
|
|
17
20
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
1
2
|
export const REVIEW_COPY = {
|
|
2
|
-
noBaseline: 'No data yet for this
|
|
3
|
+
noBaseline: 'No data yet for this goal.',
|
|
3
4
|
preview: 'Preview',
|
|
4
5
|
previewBlocked: 'Your browser blocked the preview window. Allow pop-ups for this site.',
|
|
5
6
|
placedTimes: (n)=>`(placed ${n} times on this page)`,
|
|
6
7
|
raise: 'Raise allocation',
|
|
7
|
-
addMetric: 'Add a
|
|
8
|
+
addMetric: 'Add a goal',
|
|
8
9
|
allocationBody: 'Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.',
|
|
9
10
|
allocationInvalid: 'Enter a whole percentage higher than the current allocation and no more than 100.',
|
|
10
|
-
role: '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
role: 'How it counts',
|
|
12
|
+
primary: GOAL_ROLES.primary,
|
|
13
|
+
supporting: GOAL_ROLES.secondary,
|
|
14
|
+
guardrail: GOAL_ROLES.guardrail,
|
|
15
|
+
metric: 'Goal',
|
|
16
|
+
chooseMetric: 'Choose a goal',
|
|
17
|
+
loadingMetrics: 'Loading goals…',
|
|
18
|
+
createGoal: 'Create a goal',
|
|
19
|
+
noMetrics: 'There are no goals yet.',
|
|
20
|
+
allMetricsAttached: 'Every goal is already on this test.'
|
|
17
21
|
};
|
|
@@ -3,8 +3,7 @@ export declare const SETTING_COPY: {
|
|
|
3
3
|
readonly setValues: "Set values";
|
|
4
4
|
readonly setting: "Setting";
|
|
5
5
|
readonly choose: "Choose the setting first.";
|
|
6
|
-
readonly current: "Current
|
|
7
|
-
readonly holdout: "Sees the Original.";
|
|
6
|
+
readonly current: "Current";
|
|
8
7
|
readonly yes: "Yes";
|
|
9
8
|
readonly no: "No";
|
|
10
9
|
readonly empty: "Not set";
|
|
@@ -48,7 +48,7 @@ export const SURFACE_COPY = {
|
|
|
48
48
|
backToSetup: 'Back to setup'
|
|
49
49
|
};
|
|
50
50
|
export function runningLine(days, planned, people) {
|
|
51
|
-
return `
|
|
51
|
+
return `Day ${days} of ${planned} · ${people} people so far`;
|
|
52
52
|
}
|
|
53
53
|
export function decidedLine(date, winner) {
|
|
54
54
|
return `Decided ${date}: ${winner}`;
|
|
@@ -50,9 +50,11 @@ export declare const TEST_PAGE: {
|
|
|
50
50
|
};
|
|
51
51
|
readonly hypothesis: "Why are you testing this? (optional)";
|
|
52
52
|
readonly hypothesisPlaceholder: "We believe … will … because …";
|
|
53
|
-
readonly notPlaced: "This test needs a block on a page. Add it to
|
|
54
|
-
readonly onPage: "
|
|
55
|
-
readonly openPage: "Open
|
|
53
|
+
readonly notPlaced: "This test needs a block on a page. Add it to a Test block.";
|
|
54
|
+
readonly onPage: "Page:";
|
|
55
|
+
readonly openPage: "Open page";
|
|
56
|
+
readonly published: "Published";
|
|
57
|
+
readonly draft: "Draft";
|
|
56
58
|
readonly editedOnPage: "Versions are edited on the page.";
|
|
57
59
|
readonly editOnPage: "Edit on page";
|
|
58
60
|
readonly empty: "Empty";
|
|
@@ -62,7 +64,7 @@ export declare const TEST_PAGE: {
|
|
|
62
64
|
readonly emptySlot: "Nothing in this slot yet";
|
|
63
65
|
readonly pageBinding: "Each version is a whole page at its own address.";
|
|
64
66
|
readonly pageAddress: "Page address";
|
|
65
|
-
readonly
|
|
67
|
+
readonly valueColumn: "Value";
|
|
66
68
|
readonly label: "Version label";
|
|
67
69
|
readonly weight: "Share (%)";
|
|
68
70
|
readonly balanceHelp: "Changing a share balances the other versions so the total stays at 100%.";
|
|
@@ -73,17 +75,18 @@ export declare const TEST_PAGE: {
|
|
|
73
75
|
readonly invalidShare: "Use a whole number from 0 to 100.";
|
|
74
76
|
readonly holdoutPrefix: "Holdout: ";
|
|
75
77
|
readonly allocation: "How many people take part";
|
|
78
|
+
readonly everyoneMatches: "Everyone who matches the audience takes part.";
|
|
76
79
|
readonly traffic: "How people are split";
|
|
77
80
|
readonly otherGoals: "Other goals (optional)";
|
|
78
81
|
readonly otherGoalsTitle: "Other goals";
|
|
79
82
|
readonly dontTrack: "Don't track";
|
|
80
|
-
readonly watch: "
|
|
83
|
+
readonly watch: "Also tracked";
|
|
81
84
|
readonly mustNotWorsen: "Must not get worse";
|
|
82
|
-
readonly otherGoalsHelp: "
|
|
83
|
-
readonly goal: "
|
|
85
|
+
readonly otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.";
|
|
86
|
+
readonly goal: "Main goal";
|
|
84
87
|
readonly goalHelp: "The one thing you want more of. It decides the winner.";
|
|
85
88
|
readonly guardrailsShort: "Must not get worse";
|
|
86
|
-
readonly secondaryShort: "Also
|
|
89
|
+
readonly secondaryShort: "Also tracked";
|
|
87
90
|
readonly manageGoals: "Manage goals";
|
|
88
91
|
readonly chooseGoal: "Choose a goal";
|
|
89
92
|
readonly goalsError: "Couldn't load goals. Try again.";
|
|
@@ -104,6 +107,7 @@ export declare const TEST_PAGE: {
|
|
|
104
107
|
readonly reach: "About how many people will see this per day?";
|
|
105
108
|
readonly reachHelp: "A rough number is fine. It only sets the suggested length.";
|
|
106
109
|
readonly duration: "Planned length (days)";
|
|
110
|
+
readonly endDate: "Planned end date";
|
|
107
111
|
readonly noSuggestion: "Enter a daily number above to get a suggestion. 4 weeks is a safe default.";
|
|
108
112
|
readonly chooseGoalSuggestion: "Choose a goal to get a suggestion.";
|
|
109
113
|
readonly required: "(required)";
|
|
@@ -127,7 +131,7 @@ export declare const DELETE_TEST: {
|
|
|
127
131
|
readonly changedPages: (count: number) => string;
|
|
128
132
|
readonly unreadablePages: (count: number, total: number) => string;
|
|
129
133
|
readonly pageWinner: "These addresses will change where they send visitors:";
|
|
130
|
-
readonly content: "Deleting the test does not delete your page content.
|
|
134
|
+
readonly content: "Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.";
|
|
131
135
|
readonly runningSteps: readonly ["Stop the test.", "Archive the test."];
|
|
132
136
|
readonly archiveFirst: "You can delete this test after it is archived.";
|
|
133
137
|
readonly close: "Close";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
1
2
|
import { API_MESSAGES } from './common.js';
|
|
2
3
|
import { PLACEMENT_LANGUAGES } from './languages.js';
|
|
3
|
-
const guardrailsShort = 'Must not get worse';
|
|
4
|
-
const secondaryShort = 'Also keep an eye on';
|
|
5
4
|
export const TEST_PAGE = {
|
|
6
5
|
noAudienceRules: 'No audience choices are available here. Everyone eligible takes part; leave this section as it is.',
|
|
7
6
|
editVersionsOnCanvas: 'Edit version content on the canvas.',
|
|
@@ -53,9 +52,11 @@ export const TEST_PAGE = {
|
|
|
53
52
|
},
|
|
54
53
|
hypothesis: 'Why are you testing this? (optional)',
|
|
55
54
|
hypothesisPlaceholder: 'We believe … will … because …',
|
|
56
|
-
notPlaced: 'This test needs a block on a page. Add it to
|
|
57
|
-
onPage: '
|
|
58
|
-
openPage: 'Open
|
|
55
|
+
notPlaced: 'This test needs a block on a page. Add it to a Test block.',
|
|
56
|
+
onPage: 'Page:',
|
|
57
|
+
openPage: 'Open page',
|
|
58
|
+
published: 'Published',
|
|
59
|
+
draft: 'Draft',
|
|
59
60
|
editedOnPage: 'Versions are edited on the page.',
|
|
60
61
|
editOnPage: 'Edit on page',
|
|
61
62
|
empty: 'Empty',
|
|
@@ -65,7 +66,7 @@ export const TEST_PAGE = {
|
|
|
65
66
|
emptySlot: 'Nothing in this slot yet',
|
|
66
67
|
pageBinding: 'Each version is a whole page at its own address.',
|
|
67
68
|
pageAddress: 'Page address',
|
|
68
|
-
|
|
69
|
+
valueColumn: 'Value',
|
|
69
70
|
label: 'Version label',
|
|
70
71
|
weight: 'Share (%)',
|
|
71
72
|
balanceHelp: 'Changing a share balances the other versions so the total stays at 100%.',
|
|
@@ -76,17 +77,18 @@ export const TEST_PAGE = {
|
|
|
76
77
|
invalidShare: 'Use a whole number from 0 to 100.',
|
|
77
78
|
holdoutPrefix: 'Holdout: ',
|
|
78
79
|
allocation: 'How many people take part',
|
|
80
|
+
everyoneMatches: 'Everyone who matches the audience takes part.',
|
|
79
81
|
traffic: 'How people are split',
|
|
80
82
|
otherGoals: 'Other goals (optional)',
|
|
81
83
|
otherGoalsTitle: 'Other goals',
|
|
82
84
|
dontTrack: "Don't track",
|
|
83
|
-
watch:
|
|
84
|
-
mustNotWorsen:
|
|
85
|
-
otherGoalsHelp: "
|
|
86
|
-
goal:
|
|
85
|
+
watch: GOAL_ROLES.secondary,
|
|
86
|
+
mustNotWorsen: GOAL_ROLES.guardrail,
|
|
87
|
+
otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.",
|
|
88
|
+
goal: GOAL_ROLES.primary,
|
|
87
89
|
goalHelp: 'The one thing you want more of. It decides the winner.',
|
|
88
|
-
guardrailsShort,
|
|
89
|
-
secondaryShort,
|
|
90
|
+
guardrailsShort: GOAL_ROLES.guardrail,
|
|
91
|
+
secondaryShort: GOAL_ROLES.secondary,
|
|
90
92
|
manageGoals: 'Manage goals',
|
|
91
93
|
chooseGoal: 'Choose a goal',
|
|
92
94
|
goalsError: "Couldn't load goals. Try again.",
|
|
@@ -107,6 +109,7 @@ export const TEST_PAGE = {
|
|
|
107
109
|
reach: 'About how many people will see this per day?',
|
|
108
110
|
reachHelp: 'A rough number is fine. It only sets the suggested length.',
|
|
109
111
|
duration: 'Planned length (days)',
|
|
112
|
+
endDate: 'Planned end date',
|
|
110
113
|
noSuggestion: 'Enter a daily number above to get a suggestion. 4 weeks is a safe default.',
|
|
111
114
|
chooseGoalSuggestion: 'Choose a goal to get a suggestion.',
|
|
112
115
|
required: '(required)',
|
|
@@ -142,7 +145,7 @@ export const DELETE_TEST = {
|
|
|
142
145
|
changedPages: (count)=>`${count} ${count === 1 ? 'page' : 'pages'} will change`,
|
|
143
146
|
unreadablePages: (count, total)=>total === 1 ? "You can't open this page." : count === total ? "You can't open any of these pages." : `You can't open ${count} of these pages.`,
|
|
144
147
|
pageWinner: 'These addresses will change where they send visitors:',
|
|
145
|
-
content: 'Deleting the test does not delete your page content.
|
|
148
|
+
content: 'Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.',
|
|
146
149
|
runningSteps: [
|
|
147
150
|
'Stop the test.',
|
|
148
151
|
'Archive the test.'
|
|
@@ -8,3 +8,14 @@ const formatter = new Intl.DateTimeFormat('en-GB', {
|
|
|
8
8
|
const date = value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' ? new Date(value) : null;
|
|
9
9
|
return date && Number.isFinite(date.valueOf()) ? formatter.format(date) : '—';
|
|
10
10
|
}
|
|
11
|
+
const relative = new Intl.RelativeTimeFormat('en', {
|
|
12
|
+
numeric: 'always'
|
|
13
|
+
});
|
|
14
|
+
export function relativeTime(value, now = Date.now()) {
|
|
15
|
+
const minutes = Math.max(0, Math.floor((now - Date.parse(value)) / 60_000));
|
|
16
|
+
if (!Number.isFinite(minutes)) return formatDate(value);
|
|
17
|
+
if (minutes === 0) return 'just now';
|
|
18
|
+
if (minutes < 60) return relative.format(-minutes, 'minute');
|
|
19
|
+
if (minutes < 1440) return relative.format(-Math.floor(minutes / 60), 'hour');
|
|
20
|
+
return relative.format(-Math.floor(minutes / 1440), 'day');
|
|
21
|
+
}
|
|
@@ -24,7 +24,6 @@ export declare const VERDICT_LABELS: {
|
|
|
24
24
|
'data-problem': string;
|
|
25
25
|
'guardrail-failing': string;
|
|
26
26
|
collecting: string;
|
|
27
|
-
'original-better': string;
|
|
28
27
|
'worse-none-better': string;
|
|
29
28
|
winner: string;
|
|
30
29
|
mixed: string;
|
|
@@ -36,5 +35,5 @@ export declare const VERDICT_LABELS: {
|
|
|
36
35
|
export declare function armLabel(key: string, storedLabel?: string): string;
|
|
37
36
|
export declare function statusLabel(status: Status): string;
|
|
38
37
|
export declare function phaseKindLabel(kind: 'test' | 'rollout'): string;
|
|
39
|
-
export declare function verdictCodeLabel(code: VerdictCode): string;
|
|
38
|
+
export declare function verdictCodeLabel(code: VerdictCode, controlLabel?: string): string;
|
|
40
39
|
export declare function kindLabel(kind: ExperimentKind): string;
|
|
@@ -22,7 +22,6 @@ export const VERDICT_LABELS = {
|
|
|
22
22
|
'data-problem': 'Check the data',
|
|
23
23
|
'guardrail-failing': 'An important outcome got worse',
|
|
24
24
|
collecting: 'Collecting results',
|
|
25
|
-
'original-better': 'The Original is better',
|
|
26
25
|
'worse-none-better': 'No better option',
|
|
27
26
|
winner: 'A winner',
|
|
28
27
|
mixed: 'Mixed results',
|
|
@@ -40,8 +39,8 @@ export function statusLabel(status) {
|
|
|
40
39
|
export function phaseKindLabel(kind) {
|
|
41
40
|
return PHASE_KIND_LABELS[kind];
|
|
42
41
|
}
|
|
43
|
-
export function verdictCodeLabel(code) {
|
|
44
|
-
return VERDICT_LABELS[code];
|
|
42
|
+
export function verdictCodeLabel(code, controlLabel = 'The control version') {
|
|
43
|
+
return code === 'original-better' ? `${controlLabel} is better` : VERDICT_LABELS[code];
|
|
45
44
|
}
|
|
46
45
|
export function kindLabel(kind) {
|
|
47
46
|
return KIND_LABELS[kind];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Status } from '../types/contracts.js';
|
|
2
2
|
import type { EditableField } from '../types/admin.js';
|
|
3
|
+
import type { SectionId } from './surface/contracts.js';
|
|
4
|
+
export declare function sectionLockNotice(status: Status, section: SectionId): string | null;
|
|
3
5
|
export declare function lockedReason(status: Status, field: string, table: Record<Status, readonly EditableField[]>): string | null;
|
|
@@ -1,4 +1,35 @@
|
|
|
1
|
+
import { EDITABLE_BY_STATUS } from '../collections/experiments/editability.js';
|
|
1
2
|
import { LOCKED_MESSAGES } from './copy/common.js';
|
|
3
|
+
const sectionFields = {
|
|
4
|
+
what: [
|
|
5
|
+
'name',
|
|
6
|
+
'hypothesis',
|
|
7
|
+
'flagPoint',
|
|
8
|
+
'pageCollection'
|
|
9
|
+
],
|
|
10
|
+
versions: [
|
|
11
|
+
'arms'
|
|
12
|
+
],
|
|
13
|
+
win: [
|
|
14
|
+
'metrics'
|
|
15
|
+
],
|
|
16
|
+
who: [
|
|
17
|
+
'targeting',
|
|
18
|
+
'allocation'
|
|
19
|
+
],
|
|
20
|
+
length: [
|
|
21
|
+
'analysis'
|
|
22
|
+
],
|
|
23
|
+
advanced: [
|
|
24
|
+
'analysis',
|
|
25
|
+
'exposurePolicy'
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
export function sectionLockNotice(status, section) {
|
|
29
|
+
const fields = sectionFields[section];
|
|
30
|
+
if (fields.some((field)=>EDITABLE_BY_STATUS[status].includes(field))) return null;
|
|
31
|
+
return lockedReason(status, fields[0], EDITABLE_BY_STATUS);
|
|
32
|
+
}
|
|
2
33
|
export function lockedReason(status, field, table) {
|
|
3
34
|
if ([
|
|
4
35
|
'slug',
|
|
@@ -26,7 +26,8 @@ export type VerdictCardModel = {
|
|
|
26
26
|
detail: string;
|
|
27
27
|
guardrailLine?: string;
|
|
28
28
|
};
|
|
29
|
-
export declare function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel }: {
|
|
29
|
+
export declare function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel, controlLabel }: {
|
|
30
|
+
controlLabel?: string;
|
|
30
31
|
snapshot: DisplaySnapshot;
|
|
31
32
|
decisionSnapshot?: DisplaySnapshot;
|
|
32
33
|
isDecidedTestRound: boolean;
|
|
@@ -108,5 +109,5 @@ export interface DataQualityItem {
|
|
|
108
109
|
shares?: string[];
|
|
109
110
|
}
|
|
110
111
|
export declare function dataQuality(snapshot: DisplaySnapshot, ctx?: ResultsContext): DataQualityItem[];
|
|
111
|
-
export declare function verdictLabel(snapshot: DisplaySnapshot): string;
|
|
112
|
+
export declare function verdictLabel(snapshot: DisplaySnapshot, controlLabel?: string): string;
|
|
112
113
|
export {};
|