Skip to content

Commit f3df9d0

Browse files
authored
Merge pull request #45 from aaron5670/show-traffic-allocation
Show Traffic Allocation in experiment details
2 parents c61a8c4 + af89f60 commit f3df9d0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "toggle-experiment",
33
"displayName": "Toggle Experiment",
44
"description": "A browser extension to inject the LocalStorage of a website for Optimizely experiments.",
5-
"version": "0.9.0",
5+
"version": "0.10.0",
66
"author": "Aaron van den Berg",
77
"homepage": "https://aaronvandenberg.nl/",
88
"scripts": {

src/components/SearchItem.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ const SearchItem = ({ experiment }: SearchItemProps) => {
6565
fetchExperiment();
6666
}, [opened]);
6767

68+
console.log(experimentData);
69+
6870
const addHistoryItem = async (newItem: HistoryItems) => {
6971
const maxHistoryItems = 3;
7072
const historyItemsLocalStorage = await storage.get("history");
@@ -137,15 +139,18 @@ const SearchItem = ({ experiment }: SearchItemProps) => {
137139
{loading ? (<Group position="center" my="md"><Loader /></Group>) : (
138140
<Box mb="md">
139141
<Group position="apart" my="xs">
140-
<Group>
142+
<Group position="left">
141143
<Text size="xs" fw={500}>
142144
Status:
143145
</Text>
144146
<Text size="xs" weight={500} color={status.color}>
145147
{status.name}
146148
</Text>
149+
<Text size="xs">
150+
{experimentData?.traffic_allocation / 100}% traffic
151+
</Text>
147152
</Group>
148-
<Text>
153+
<Text size="xs">
149154
<Anchor
150155
href={`https://app.optimizely.com/v2/projects/${experiment.project_id}/experiments/${experiment.id}`}
151156
target="_blank">

0 commit comments

Comments
 (0)