-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 add support for funnel steps and timeframe
- Loading branch information
Artur Pryka
committed
Sep 30, 2020
1 parent
ff98816
commit ad36d3c
Showing
44 changed files
with
1,050 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,5 @@ | ||
import styled from 'styled-components'; | ||
import { colors } from '@keen.io/colors'; | ||
// import { Card as BaseCard } from '@keen.io/ui-core'; | ||
|
||
// export const Card = styled(BaseCard)` | ||
// height: auto; | ||
// `; | ||
|
||
export const Wrapper = styled.div` | ||
padding: 20px; | ||
`; | ||
|
||
export const StyledTable = styled.table` | ||
border-collapse: collapse; | ||
table-layout: fixed; | ||
text-align: left; | ||
`; | ||
|
||
export const StyledBody = styled.tbody``; | ||
|
||
export const Row = styled.tr` | ||
vertical-align: top; | ||
`; | ||
|
||
export const Label = styled.th` | ||
padding: 0 20px 10px 0; | ||
font-family: 'Lato Bold', sans-serif; | ||
font-size: 14px; | ||
line-height: 17px; | ||
color: ${colors.black[100]}; | ||
`; | ||
|
||
export const Value = styled.td` | ||
padding: 0 0 10px 0; | ||
font-family: 'Lato Regular', sans-serif; | ||
font-size: 14px; | ||
line-height: 17px; | ||
color: ${colors.black[100]}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* eslint-disable @typescript-eslint/camelcase */ | ||
import React from 'react'; | ||
import { render as rtlRender } from '@testing-library/react'; | ||
|
||
import QuerySummary from './QuerySummary'; | ||
|
||
const render = (overProps: any = {}) => { | ||
const props = { | ||
querySettings: { | ||
query: { | ||
analysis_type: 'sum', | ||
event_collection: 'purchases', | ||
target_property: 'item.price', | ||
timezone: 'UTC', | ||
filters: [ | ||
{ | ||
operator: 'gt', | ||
property_value: '100', | ||
property_name: 'item.quantity', | ||
}, | ||
], | ||
}, | ||
}, | ||
...overProps, | ||
}; | ||
|
||
const wrapper = rtlRender(<QuerySummary {...props} />); | ||
|
||
return { | ||
wrapper, | ||
props, | ||
}; | ||
}; | ||
|
||
test('should render query summary', () => { | ||
const { | ||
wrapper: { container }, | ||
} = render(); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render query summary for funnels', () => { | ||
const querySettings = { | ||
query: { | ||
analysis_type: 'funnel', | ||
steps: [ | ||
{ | ||
with_actors: false, | ||
actor_property: 'user.id', | ||
filters: [], | ||
timeframe: 'this_14_days', | ||
timezone: 'UTC', | ||
event_collection: 'signups', | ||
optional: false, | ||
inverted: false, | ||
}, | ||
{ | ||
with_actors: false, | ||
actor_property: 'user.id', | ||
filters: [], | ||
timeframe: 'this_14_days', | ||
timezone: 'UTC', | ||
event_collection: 'purchases', | ||
optional: false, | ||
inverted: false, | ||
}, | ||
], | ||
}, | ||
}; | ||
const { | ||
wrapper: { container }, | ||
} = render({ querySettings }); | ||
expect(container).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.