@@ -16,15 +16,11 @@ import uniqid from "uniqid";
1616import { createDimension } from "../models/DimensionModel" ;
1717import { getSourceIntegrationObject } from "../services/datasource" ;
1818import { ExperimentInterface } from "../../types/experiment" ;
19- import { createIdea } from "../services/ideas" ;
20- import { createImpactEstimate } from "../models/ImpactEstimateModel" ;
21- import { createPresentation } from "../services/presentations" ;
2219import {
2320 getOrganizationsWithDatasources ,
2421 createDataSource ,
2522} from "../models/DataSourceModel" ;
2623import { POSTGRES_TEST_CONN } from "../util/secrets" ;
27- import { PresentationSlide } from "../../types/presentation" ;
2824import { processPastExperimentQueryResponse } from "../services/queries" ;
2925
3026export async function getOrganizations ( req : AuthRequest , res : Response ) {
@@ -92,13 +88,6 @@ export async function addSampleData(req: AuthRequest, res: Response) {
9288 variation_id
9389 FROM
9490 experiment_viewed` ,
95- pageviewsQuery : `SELECT
96- user_id,
97- user_id as anonymous_id,
98- received_at as timestamp,
99- '' as url
100- FROM
101- pages` ,
10291 } ,
10392 }
10493 ) ;
@@ -369,48 +358,6 @@ export async function addSampleData(req: AuthRequest, res: Response) {
369358 } )
370359 ) ;
371360
372- // Example idea
373- const estimate = await createImpactEstimate (
374- org . id ,
375- signup . id ,
376- "" ,
377- ".*" ,
378- 153.429 ,
379- 1901.71 ,
380- 153.429 ,
381- "-- Traffic to selected pages\nSELECT\n COUNT(DISTINCT user_id) as users\nFROM\n pages\nWHERE\n received_at >= '2020-11-13 16:26:12'\n AND received_at <= '2020-11-20 16:26:12'\n AND path ~ '.*';\n\n-- Entire site: Signup (binomial)\nWITH metric as (\n SELECT\n 1 as value\n FROM\n pages u\n JOIN signup m ON (\n m.user_id = u.user_id\n AND m.received_at >= u.received_at\n AND m.received_at <= u.received_at + INTERVAL '3 days'\n )\n WHERE\n u.received_at >= '2020-11-13 16:26:12'\n AND u.received_at <= '2020-11-20 16:26:12'\n GROUP BY\n u.user_id\n)\nSELECT\n SUM(value) as total\nFROM\n metric;\n\n-- Selected pages only: Signup (binomial)\nWITH metric as (\n SELECT\n 1 as value\n FROM\n pages u\n JOIN signup m ON (\n m.user_id = u.user_id\n AND m.received_at >= u.received_at\n AND m.received_at <= u.received_at + INTERVAL '3 days'\n )\n WHERE\n u.received_at >= '2020-11-13 16:26:12'\n AND u.received_at <= '2020-11-20 16:26:12'\n AND u.path ~ '.*'\n GROUP BY\n u.user_id\n)\nSELECT\n SUM(value) as value\nFROM\n metric;" ,
382- "sql"
383- ) ;
384- await createIdea ( {
385- text : "Add Facebook Login" ,
386- details : "We saw a huge lift when we added Login with Google" ,
387- estimateParams : {
388- estimate : estimate . id ,
389- improvement : 10 ,
390- numVariations : 2 ,
391- userAdjustment : 100 ,
392- } ,
393- experimentLength : 18 ,
394- impactScore : 38 ,
395- votes : [ ] ,
396- tags : [ ] ,
397- organization : org . id ,
398- userId : "growthbook" ,
399- userName : "Example User" ,
400- } ) ;
401-
402- // Example presentation
403- const exp : PresentationSlide = {
404- id : evidence [ 0 ] ,
405- type : "experiment" ,
406- } ;
407- await createPresentation ( {
408- title : "Example A/B Test Review" ,
409- slides : [ exp ] ,
410- organization : org . id ,
411- description : "" ,
412- } ) ;
413-
414361 res . json ( {
415362 status : 200 ,
416363 } ) ;
0 commit comments