onRowClick(e, row)}
+ >
{ cols.map(({ cellClass = '', className = '', Component, key, toText = t => t, width }) => (
{ Component
?
diff --git a/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx b/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx
index 4ff533029..db6585654 100644
--- a/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx
+++ b/frontend/app/components/shared/CustomMetrics/CustomMetricForm/CustomMetricForm.tsx
@@ -9,6 +9,7 @@ import { toast } from 'react-toastify';
import cn from 'classnames';
import DropdownPlain from '../../DropdownPlain';
import { metricTypes, metricOf, issueOptions } from 'App/constants/filterOptions';
+import { FilterKey } from 'Types/filter/filterType';
interface Props {
metric: any;
editMetric: (metric, shouldFetch?) => void;
@@ -23,11 +24,11 @@ interface Props {
function CustomMetricForm(props: Props) {
const { metric, loading } = props;
// const metricOfOptions = metricOf.filter(i => i.key === metric.metricType);
- const timeseriesOptions = metricOf.filter(i => i.key === 'timeseries');
- const tableOptions = metricOf.filter(i => i.key === 'table');
+ const timeseriesOptions = metricOf.filter(i => i.type === 'timeseries');
+ const tableOptions = metricOf.filter(i => i.type === 'table');
const isTable = metric.metricType === 'table';
const isTimeSeries = metric.metricType === 'timeseries';
- const _issueOptions = [{ text: 'All', value: '' }].concat(issueOptions);
+ const _issueOptions = [{ text: 'All', value: 'all' }].concat(issueOptions);
const addSeries = () => {
@@ -47,8 +48,8 @@ function CustomMetricForm(props: Props) {
}
if (name === 'metricOf') {
- if (value === 'ISSUES') {
- props.editMetric({ metricValue: [''] }, false);
+ if (value === FilterKey.ISSUE) {
+ props.editMetric({ metricValue: ['all'] }, false);
}
}
@@ -139,7 +140,7 @@ function CustomMetricForm(props: Props) {
>
)}
- {metric.metricOf === 'ISSUES' && (
+ {metric.metricOf === FilterKey.ISSUE && (
<>
issue type
removeSeries(index)}
canDelete={metric.series.size > 1}
+ emptyMessage={isTable ?
+ 'Filter table data by user environment and metadata attributes. Use add step button below to filter.' :
+ 'Add user event or filter to define the series by clicking Add Step.'
+ }
/>
))}
diff --git a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx
index bafa68fd1..d6434fadb 100644
--- a/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx
+++ b/frontend/app/components/shared/CustomMetrics/SessionListModal/SessionListModal.tsx
@@ -23,7 +23,8 @@ function SessionListModal(props: Props) {
props.fetchSessionList({
metricId: activeWidget.widget.metricId,
startDate: activeWidget.startTimestamp,
- endDate: activeWidget.endTimestamp
+ endDate: activeWidget.endTimestamp,
+ filters: activeWidget.filters || [],
});
}, [activeWidget]);
diff --git a/frontend/app/components/shared/DateRangeDropdown/dateRangeDropdown.css b/frontend/app/components/shared/DateRangeDropdown/dateRangeDropdown.css
index 27ae5b3bc..1cf17bf82 100644
--- a/frontend/app/components/shared/DateRangeDropdown/dateRangeDropdown.css
+++ b/frontend/app/components/shared/DateRangeDropdown/dateRangeDropdown.css
@@ -1,5 +1,5 @@
.button {
- padding: 0 8px;
+ padding: 0 4px;
border-radius: 3px;
color: $teal;
cursor: pointer;
@@ -12,7 +12,7 @@
}
.dropdownTrigger {
- padding: 4px 6px;
+ padding: 4px;
&:hover {
background-color: $gray-light;
}
@@ -42,7 +42,7 @@
.dropdown {
display: flex !important;
- padding: 4px 6px;
+ padding: 4px 4px;
border-radius: 3px;
color: $gray-darkest;
font-weight: 500;
@@ -52,7 +52,7 @@
}
.dropdownTrigger {
- padding: 4px 8px;
+ padding: 4px 4px;
border-radius: 3px;
&:hover {
background-color: $gray-light;
diff --git a/frontend/app/components/shared/DropdownPlain/DropdownPlain.css b/frontend/app/components/shared/DropdownPlain/DropdownPlain.css
index 1bf3e305c..dd7b9a2a5 100644
--- a/frontend/app/components/shared/DropdownPlain/DropdownPlain.css
+++ b/frontend/app/components/shared/DropdownPlain/DropdownPlain.css
@@ -1,6 +1,6 @@
.dropdown {
display: flex !important;
- padding: 4px 6px;
+ padding: 4px;
border-radius: 3px;
color: $gray-darkest;
font-weight: 500;
@@ -12,7 +12,7 @@
}
.dropdownTrigger {
- padding: 4px 8px;
+ padding: 4px;
border-radius: 3px;
&:hover {
background-color: $gray-light;
diff --git a/frontend/app/constants/filterOptions.js b/frontend/app/constants/filterOptions.js
index 6b9b5b70d..6fa6d0cbf 100644
--- a/frontend/app/constants/filterOptions.js
+++ b/frontend/app/constants/filterOptions.js
@@ -1,3 +1,5 @@
+import { FilterKey } from 'Types/filter/filterType';
+
export const options = [
{ key: 'on', text: 'on', value: 'on' },
{ key: 'notOn', text: 'not on', value: 'notOn' },
@@ -60,13 +62,13 @@ export const metricTypes = [
];
export const metricOf = [
- { text: 'Session Count', value: 'sessionCount', key: 'timeseries' },
- { text: 'Users', value: 'USERID', key: 'table' },
- { text: 'Issues', value: 'ISSUES', key: 'table' },
- { text: 'Browser', value: 'USERBROWSER', key: 'table' },
- { text: 'Device', value: 'USERDEVICE', key: 'table' },
- { text: 'Country', value: 'USERCOUNTRY', key: 'table' },
- { text: 'URL', value: 'VISITED_URL', key: 'table' },
+ { text: 'Session Count', value: 'sessionCount', type: 'timeseries' },
+ { text: 'Users', value: FilterKey.USERID, type: 'table' },
+ { text: 'Issues', value: FilterKey.ISSUE, type: 'table' },
+ { text: 'Browser', value: FilterKey.USER_BROWSER, type: 'table' },
+ { text: 'Device', value: FilterKey.USER_DEVICE, type: 'table' },
+ { text: 'Country', value: FilterKey.USER_COUNTRY, type: 'table' },
+ { text: 'URL', value: FilterKey.LOCATION, type: 'table' },
]
export const issueOptions = [
diff --git a/frontend/app/types/customMetric.js b/frontend/app/types/customMetric.js
index 0686af87d..0140faec4 100644
--- a/frontend/app/types/customMetric.js
+++ b/frontend/app/types/customMetric.js
@@ -3,6 +3,7 @@ import { List } from 'immutable';
import Filter from 'Types/filter';
import { validateName } from 'App/validate';
import { LAST_7_DAYS } from 'Types/app/period';
+import { FilterKey } from 'Types/filter/filterType';
import { filterMap } from 'Duck/search';
export const FilterSeries = Record({
@@ -47,11 +48,13 @@ export default Record({
toSaveData() {
const js = this.toJS();
+
+ js.metricValue = js.metricValue.map(value => value === 'all' ? '' : value);
js.series = js.series.map(series => {
series.filter.filters = series.filter.filters.map(filterMap);
// delete series._key
- // delete series.key
+ delete series.key
return series;
});
@@ -65,8 +68,10 @@ export default Record({
return js;
},
},
- fromJS: ({ series, ...rest }) => ({
+ fromJS: ({ metricOf, metricValue, series, ...rest }) => ({
...rest,
series: List(series).map(FilterSeries),
+ metricOf,
+ metricValue: metricOf === FilterKey.ISSUE && metricValue.length === 0 ? ['all'] : metricValue,
}),
});